@ixo/editor 3.2.2 → 3.4.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-Y55JRNQJ.mjs → chunk-CITHJ6JU.mjs} +567 -241
- package/dist/chunk-CITHJ6JU.mjs.map +1 -0
- package/dist/core/index.d.ts +4 -3
- package/dist/{graphql-client-BxmM6bOC.d.ts → graphql-client-vuaTCDox.d.ts} +69 -23
- package/dist/{index-DMrZ4EwQ.d.ts → index-MLwb3a2P.d.ts} +12 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/mantine/index.d.ts +12 -12
- package/dist/mantine/index.mjs +1 -1
- package/dist/{setup-B0la8n04.d.ts → setup-mrrJlbcA.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-Y55JRNQJ.mjs.map +0 -1
|
@@ -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,
|
|
@@ -29956,7 +29968,7 @@ var LocationFlowView = ({ editor, block }) => {
|
|
|
29956
29968
|
// src/mantine/blocks/location/LocationBlock.tsx
|
|
29957
29969
|
function LocationBlock({ editor, block }) {
|
|
29958
29970
|
const { docType } = useBlocknoteContext();
|
|
29959
|
-
if (docType === "template"
|
|
29971
|
+
if (docType === "template") {
|
|
29960
29972
|
return /* @__PURE__ */ React282.createElement(LocationTemplateView, { editor, block });
|
|
29961
29973
|
}
|
|
29962
29974
|
return /* @__PURE__ */ React282.createElement(LocationFlowView, { editor, block });
|
|
@@ -30197,7 +30209,7 @@ var EmbedFlowView = ({ editor, block }) => {
|
|
|
30197
30209
|
// src/mantine/blocks/embed/EmbedBlock.tsx
|
|
30198
30210
|
function EmbedBlock({ editor, block }) {
|
|
30199
30211
|
const { docType } = useBlocknoteContext();
|
|
30200
|
-
if (docType === "template"
|
|
30212
|
+
if (docType === "template") {
|
|
30201
30213
|
return /* @__PURE__ */ React289.createElement(EmbedTemplateView, { editor, block });
|
|
30202
30214
|
}
|
|
30203
30215
|
return /* @__PURE__ */ React289.createElement(EmbedFlowView, { editor, block });
|
|
@@ -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,11 +30910,6 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30862
30910
|
subtext: "Embed an external website or content via iframe"
|
|
30863
30911
|
}
|
|
30864
30912
|
];
|
|
30865
|
-
const yRoot = editor?._yRoot;
|
|
30866
|
-
const docType = yRoot?.get("docType");
|
|
30867
|
-
if (docType === "page") {
|
|
30868
|
-
return slashMenuList.filter((item) => item.title !== "Proposal");
|
|
30869
|
-
}
|
|
30870
30913
|
return slashMenuList;
|
|
30871
30914
|
};
|
|
30872
30915
|
|
|
@@ -30928,6 +30971,7 @@ function useCreateIxoEditor(options) {
|
|
|
30928
30971
|
};
|
|
30929
30972
|
ixoEditor.mode = "flow";
|
|
30930
30973
|
ixoEditor.docType = docType;
|
|
30974
|
+
ixoEditor.hasBlockType = (type) => (ixoEditor.document || []).some((b) => b.type === type);
|
|
30931
30975
|
ixoEditor.isEditable = editable;
|
|
30932
30976
|
return ixoEditor;
|
|
30933
30977
|
}
|
|
@@ -30953,7 +30997,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
30953
30997
|
updateEventType: "matrix-crdt.doc_update",
|
|
30954
30998
|
snapshotEventType: "matrix-crdt.doc_snapshot"
|
|
30955
30999
|
},
|
|
30956
|
-
enableExperimentalWebrtcSync:
|
|
31000
|
+
enableExperimentalWebrtcSync: false,
|
|
30957
31001
|
enableAwareness: true,
|
|
30958
31002
|
reader: { snapshotInterval: 10 },
|
|
30959
31003
|
writer: { flushInterval: 300, retryIfForbiddenInterval: 3e4 }
|
|
@@ -31551,6 +31595,47 @@ function useFlowLifecycle({ editor, connectionStatus, enabled = true }) {
|
|
|
31551
31595
|
}, [editor, connectionStatus, enabled, runPipeline]);
|
|
31552
31596
|
}
|
|
31553
31597
|
|
|
31598
|
+
// src/mantine/utils/iconToAvatar.ts
|
|
31599
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
31600
|
+
import * as TablerIcons from "@tabler/icons-react";
|
|
31601
|
+
import { createElement } from "react";
|
|
31602
|
+
function isTablerIconName(value) {
|
|
31603
|
+
return value.startsWith("Icon") && typeof TablerIcons[value] === "function";
|
|
31604
|
+
}
|
|
31605
|
+
function tablerIconToSvgBlob(iconName) {
|
|
31606
|
+
const Icon = TablerIcons[iconName];
|
|
31607
|
+
if (!Icon || typeof Icon !== "function") return null;
|
|
31608
|
+
const svg = renderToStaticMarkup(createElement(Icon, { size: 120, stroke: 1.5, color: "#868e96" }));
|
|
31609
|
+
return new Blob([svg], { type: "image/svg+xml" });
|
|
31610
|
+
}
|
|
31611
|
+
async function uploadToMatrix(matrixClient, blob, contentType, fileName) {
|
|
31612
|
+
const result = await matrixClient.uploadContent(blob, {
|
|
31613
|
+
type: contentType,
|
|
31614
|
+
name: fileName
|
|
31615
|
+
});
|
|
31616
|
+
return result.content_uri ?? result;
|
|
31617
|
+
}
|
|
31618
|
+
async function mirrorIconToRoomAvatar(matrixClient, roomId, iconValue) {
|
|
31619
|
+
if (!iconValue) {
|
|
31620
|
+
await matrixClient.sendStateEvent(roomId, "m.room.avatar", {}, "");
|
|
31621
|
+
return;
|
|
31622
|
+
}
|
|
31623
|
+
let blob = null;
|
|
31624
|
+
let contentType = "image/svg+xml";
|
|
31625
|
+
let fileName = "avatar.svg";
|
|
31626
|
+
if (isTablerIconName(iconValue)) {
|
|
31627
|
+
blob = tablerIconToSvgBlob(iconValue);
|
|
31628
|
+
} else if (iconValue.startsWith("http")) {
|
|
31629
|
+
const response = await fetch(iconValue);
|
|
31630
|
+
blob = await response.blob();
|
|
31631
|
+
contentType = blob.type || "image/png";
|
|
31632
|
+
fileName = `avatar.${contentType.split("/")[1] || "png"}`;
|
|
31633
|
+
}
|
|
31634
|
+
if (!blob) return;
|
|
31635
|
+
const mxcUri = await uploadToMatrix(matrixClient, blob, contentType, fileName);
|
|
31636
|
+
await matrixClient.sendStateEvent(roomId, "m.room.avatar", { url: mxcUri }, "");
|
|
31637
|
+
}
|
|
31638
|
+
|
|
31554
31639
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
31555
31640
|
function useCreateCollaborativeIxoEditor(options) {
|
|
31556
31641
|
const yDoc = useCollaborativeYDoc(options);
|
|
@@ -31689,6 +31774,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31689
31774
|
ixoEditor.mode = editable ? "template" : "flow";
|
|
31690
31775
|
ixoEditor.user = memoizedUser;
|
|
31691
31776
|
ixoEditor.docType = docType;
|
|
31777
|
+
ixoEditor.hasBlockType = (type) => (ixoEditor.document || []).some((b) => b.type === type);
|
|
31692
31778
|
ixoEditor.getUserProps = (block) => {
|
|
31693
31779
|
return userFragment.get(block.id) || {};
|
|
31694
31780
|
};
|
|
@@ -31838,6 +31924,11 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31838
31924
|
}
|
|
31839
31925
|
const current = metadataManager.getMetadata() || {};
|
|
31840
31926
|
await metadataManager.setMetadata({ ...current, ...updates }, permissions);
|
|
31927
|
+
if ("icon" in updates) {
|
|
31928
|
+
mirrorIconToRoomAvatar(matrixClient, options.roomId, updates.icon).catch((error) => {
|
|
31929
|
+
console.error("Failed to mirror icon to m.room.avatar:", error);
|
|
31930
|
+
});
|
|
31931
|
+
}
|
|
31841
31932
|
};
|
|
31842
31933
|
ixoEditor.getPageMetadata = () => {
|
|
31843
31934
|
return metadataManager.getMetadata();
|
|
@@ -31959,15 +32050,224 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31959
32050
|
}
|
|
31960
32051
|
|
|
31961
32052
|
// src/mantine/IxoEditor.tsx
|
|
31962
|
-
import
|
|
31963
|
-
import { SuggestionMenuController } from "@blocknote/react";
|
|
32053
|
+
import React300 from "react";
|
|
32054
|
+
import { SuggestionMenuController, getDefaultReactSlashMenuItems } from "@blocknote/react";
|
|
31964
32055
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
31965
32056
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
31966
32057
|
import { MantineProvider } from "@mantine/core";
|
|
31967
32058
|
|
|
32059
|
+
// src/mantine/components/CommandPalette.tsx
|
|
32060
|
+
import React291, { useEffect as useEffect108, useRef as useRef29, useState as useState133, useMemo as useMemo120, useCallback as useCallback109 } from "react";
|
|
32061
|
+
import { Box as Box58, Text as Text170, Stack as Stack196 } from "@mantine/core";
|
|
32062
|
+
var GROUP_ORDER = {
|
|
32063
|
+
Headings: 0,
|
|
32064
|
+
"Basic blocks": 1,
|
|
32065
|
+
Media: 2,
|
|
32066
|
+
Advanced: 3,
|
|
32067
|
+
Others: 4,
|
|
32068
|
+
Basics: 5,
|
|
32069
|
+
Domains: 6,
|
|
32070
|
+
DAO: 7,
|
|
32071
|
+
Flows: 8
|
|
32072
|
+
};
|
|
32073
|
+
function PaletteItem({ item, isSelected, onClick, id }) {
|
|
32074
|
+
const ref = useRef29(null);
|
|
32075
|
+
const [hovered, setHovered] = useState133(false);
|
|
32076
|
+
useEffect108(() => {
|
|
32077
|
+
if (isSelected && ref.current) {
|
|
32078
|
+
ref.current.scrollIntoView({ block: "nearest" });
|
|
32079
|
+
}
|
|
32080
|
+
}, [isSelected]);
|
|
32081
|
+
const highlighted = isSelected || hovered;
|
|
32082
|
+
return /* @__PURE__ */ React291.createElement(
|
|
32083
|
+
Box58,
|
|
32084
|
+
{
|
|
32085
|
+
ref,
|
|
32086
|
+
id,
|
|
32087
|
+
role: "option",
|
|
32088
|
+
"aria-selected": isSelected || void 0,
|
|
32089
|
+
onClick,
|
|
32090
|
+
onMouseEnter: () => setHovered(true),
|
|
32091
|
+
onMouseLeave: () => setHovered(false),
|
|
32092
|
+
style: {
|
|
32093
|
+
display: "flex",
|
|
32094
|
+
alignItems: "center",
|
|
32095
|
+
gap: 10,
|
|
32096
|
+
padding: "6px 8px",
|
|
32097
|
+
cursor: "pointer",
|
|
32098
|
+
borderRadius: 6,
|
|
32099
|
+
margin: "0 6px",
|
|
32100
|
+
transition: "background-color 0.1s ease",
|
|
32101
|
+
backgroundColor: highlighted ? "var(--mantine-color-neutralColor-4)" : "transparent"
|
|
32102
|
+
}
|
|
32103
|
+
},
|
|
32104
|
+
/* @__PURE__ */ React291.createElement(
|
|
32105
|
+
Box58,
|
|
32106
|
+
{
|
|
32107
|
+
style: {
|
|
32108
|
+
width: 32,
|
|
32109
|
+
height: 32,
|
|
32110
|
+
minWidth: 32,
|
|
32111
|
+
display: "flex",
|
|
32112
|
+
alignItems: "center",
|
|
32113
|
+
justifyContent: "center",
|
|
32114
|
+
borderRadius: 6,
|
|
32115
|
+
backgroundColor: "var(--mantine-color-neutralColor-4)",
|
|
32116
|
+
border: "1px solid var(--mantine-color-neutralColor-5)"
|
|
32117
|
+
}
|
|
32118
|
+
},
|
|
32119
|
+
item.icon
|
|
32120
|
+
),
|
|
32121
|
+
/* @__PURE__ */ React291.createElement(Stack196, { gap: 0, style: { overflow: "hidden", minWidth: 0, flex: 1 } }, /* @__PURE__ */ React291.createElement(
|
|
32122
|
+
Text170,
|
|
32123
|
+
{
|
|
32124
|
+
size: "sm",
|
|
32125
|
+
fw: 500,
|
|
32126
|
+
truncate: true,
|
|
32127
|
+
style: {
|
|
32128
|
+
color: "var(--mantine-color-neutralColor-8) !important"
|
|
32129
|
+
}
|
|
32130
|
+
},
|
|
32131
|
+
item.title
|
|
32132
|
+
), item.subtext && /* @__PURE__ */ React291.createElement(
|
|
32133
|
+
Text170,
|
|
32134
|
+
{
|
|
32135
|
+
size: "xs",
|
|
32136
|
+
truncate: true,
|
|
32137
|
+
style: {
|
|
32138
|
+
color: "var(--mantine-color-neutralColor-7) !important"
|
|
32139
|
+
}
|
|
32140
|
+
},
|
|
32141
|
+
item.subtext
|
|
32142
|
+
))
|
|
32143
|
+
);
|
|
32144
|
+
}
|
|
32145
|
+
function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
32146
|
+
const groupedItems = useMemo120(() => {
|
|
32147
|
+
const groups = [];
|
|
32148
|
+
let currentGroup;
|
|
32149
|
+
for (let i = 0; i < items.length; i++) {
|
|
32150
|
+
const item = items[i];
|
|
32151
|
+
if (item.group !== currentGroup) {
|
|
32152
|
+
currentGroup = item.group;
|
|
32153
|
+
groups.push({ label: currentGroup || "", items: [] });
|
|
32154
|
+
}
|
|
32155
|
+
groups[groups.length - 1].items.push({ item, globalIndex: i });
|
|
32156
|
+
}
|
|
32157
|
+
return groups;
|
|
32158
|
+
}, [items]);
|
|
32159
|
+
const handleItemClick = useCallback109(
|
|
32160
|
+
(item) => {
|
|
32161
|
+
onItemClick?.(item);
|
|
32162
|
+
},
|
|
32163
|
+
[onItemClick]
|
|
32164
|
+
);
|
|
32165
|
+
if (loadingState === "loading-initial") {
|
|
32166
|
+
return /* @__PURE__ */ React291.createElement(
|
|
32167
|
+
Box58,
|
|
32168
|
+
{
|
|
32169
|
+
style: {
|
|
32170
|
+
width: 330,
|
|
32171
|
+
padding: "12px",
|
|
32172
|
+
backgroundColor: "var(--mantine-color-neutralColor-3)",
|
|
32173
|
+
border: "1px solid var(--mantine-color-neutralColor-5)",
|
|
32174
|
+
borderRadius: 10,
|
|
32175
|
+
boxShadow: "0 4px 16px rgba(0, 0, 0, 0.2)"
|
|
32176
|
+
}
|
|
32177
|
+
},
|
|
32178
|
+
/* @__PURE__ */ React291.createElement(Text170, { size: "sm", style: { color: "var(--mantine-color-neutralColor-7) !important", textAlign: "center" } }, "Loading...")
|
|
32179
|
+
);
|
|
32180
|
+
}
|
|
32181
|
+
return /* @__PURE__ */ React291.createElement(
|
|
32182
|
+
Box58,
|
|
32183
|
+
{
|
|
32184
|
+
id: "bn-suggestion-menu",
|
|
32185
|
+
role: "listbox",
|
|
32186
|
+
style: {
|
|
32187
|
+
width: 330,
|
|
32188
|
+
maxHeight: 350,
|
|
32189
|
+
overflow: "hidden",
|
|
32190
|
+
backgroundColor: "var(--mantine-color-neutralColor-3)",
|
|
32191
|
+
border: "1px solid var(--mantine-color-neutralColor-5)",
|
|
32192
|
+
borderRadius: 10,
|
|
32193
|
+
boxShadow: "0 4px 16px rgba(0, 0, 0, 0.2)",
|
|
32194
|
+
padding: "6px 0"
|
|
32195
|
+
}
|
|
32196
|
+
},
|
|
32197
|
+
/* @__PURE__ */ React291.createElement(
|
|
32198
|
+
Box58,
|
|
32199
|
+
{
|
|
32200
|
+
style: {
|
|
32201
|
+
maxHeight: 338,
|
|
32202
|
+
overflowY: "auto",
|
|
32203
|
+
overflowX: "hidden",
|
|
32204
|
+
scrollbarWidth: "none",
|
|
32205
|
+
msOverflowStyle: "none"
|
|
32206
|
+
}
|
|
32207
|
+
},
|
|
32208
|
+
groupedItems.map((group) => /* @__PURE__ */ React291.createElement(React291.Fragment, { key: group.label }, /* @__PURE__ */ React291.createElement(
|
|
32209
|
+
Text170,
|
|
32210
|
+
{
|
|
32211
|
+
size: "xs",
|
|
32212
|
+
fw: 600,
|
|
32213
|
+
style: {
|
|
32214
|
+
textTransform: "uppercase",
|
|
32215
|
+
letterSpacing: "0.04em",
|
|
32216
|
+
color: "var(--mantine-color-neutralColor-7) !important",
|
|
32217
|
+
padding: "8px 14px 4px 14px",
|
|
32218
|
+
fontSize: 11
|
|
32219
|
+
}
|
|
32220
|
+
},
|
|
32221
|
+
group.label
|
|
32222
|
+
), group.items.map(({ item, globalIndex }) => /* @__PURE__ */ React291.createElement(
|
|
32223
|
+
PaletteItem,
|
|
32224
|
+
{
|
|
32225
|
+
key: `${item.title}-${globalIndex}`,
|
|
32226
|
+
item,
|
|
32227
|
+
isSelected: globalIndex === selectedIndex,
|
|
32228
|
+
onClick: () => handleItemClick(item),
|
|
32229
|
+
id: `bn-suggestion-menu-item-${globalIndex}`
|
|
32230
|
+
}
|
|
32231
|
+
)))),
|
|
32232
|
+
items.length === 0 && (loadingState === "loaded" || loadingState === "loading") && /* @__PURE__ */ React291.createElement(
|
|
32233
|
+
Text170,
|
|
32234
|
+
{
|
|
32235
|
+
size: "sm",
|
|
32236
|
+
style: {
|
|
32237
|
+
color: "var(--mantine-color-neutralColor-7) !important",
|
|
32238
|
+
textAlign: "center",
|
|
32239
|
+
padding: "12px"
|
|
32240
|
+
}
|
|
32241
|
+
},
|
|
32242
|
+
"No results"
|
|
32243
|
+
)
|
|
32244
|
+
)
|
|
32245
|
+
);
|
|
32246
|
+
}
|
|
32247
|
+
|
|
32248
|
+
// src/mantine/IxoEditor.tsx
|
|
32249
|
+
import {
|
|
32250
|
+
IconH1,
|
|
32251
|
+
IconH2,
|
|
32252
|
+
IconH3,
|
|
32253
|
+
IconBlockquote,
|
|
32254
|
+
IconListNumbers,
|
|
32255
|
+
IconList as IconList2,
|
|
32256
|
+
IconListCheck,
|
|
32257
|
+
IconPilcrow,
|
|
32258
|
+
IconCode as IconCode4,
|
|
32259
|
+
IconTable as IconTable2,
|
|
32260
|
+
IconPhoto as IconPhoto5,
|
|
32261
|
+
IconVideo,
|
|
32262
|
+
IconVolume,
|
|
32263
|
+
IconFile as IconFile5,
|
|
32264
|
+
IconMoodSmile as IconMoodSmile2,
|
|
32265
|
+
IconPageBreak
|
|
32266
|
+
} from "@tabler/icons-react";
|
|
32267
|
+
|
|
31968
32268
|
// src/mantine/components/PanelContent.tsx
|
|
31969
|
-
import
|
|
31970
|
-
import { Box as
|
|
32269
|
+
import React292 from "react";
|
|
32270
|
+
import { Box as Box59 } from "@mantine/core";
|
|
31971
32271
|
var panelStyles = {
|
|
31972
32272
|
light: {
|
|
31973
32273
|
backgroundColor: "#ffffff",
|
|
@@ -31996,8 +32296,8 @@ function PanelContent({ theme }) {
|
|
|
31996
32296
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
31997
32297
|
const isOpen = activePanel !== null;
|
|
31998
32298
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
31999
|
-
return /* @__PURE__ */
|
|
32000
|
-
|
|
32299
|
+
return /* @__PURE__ */ React292.createElement(
|
|
32300
|
+
Box59,
|
|
32001
32301
|
{
|
|
32002
32302
|
pos: "sticky",
|
|
32003
32303
|
right: 0,
|
|
@@ -32016,8 +32316,8 @@ function PanelContent({ theme }) {
|
|
|
32016
32316
|
}
|
|
32017
32317
|
|
|
32018
32318
|
// src/mantine/components/CoverImage.tsx
|
|
32019
|
-
import
|
|
32020
|
-
import { Box as
|
|
32319
|
+
import React297, { useState as useState137, useRef as useRef30, useEffect as useEffect111, useMemo as useMemo123 } from "react";
|
|
32320
|
+
import { Box as Box63, Group as Group109 } from "@mantine/core";
|
|
32021
32321
|
import { IconMoodSmile, IconPhoto as IconPhoto4, IconSettings as IconSettings22, IconArrowsMove, IconTrash as IconTrash11, IconRefresh as IconRefresh5 } from "@tabler/icons-react";
|
|
32022
32322
|
|
|
32023
32323
|
// src/core/lib/imageTransform.ts
|
|
@@ -32151,11 +32451,11 @@ function transformIconImage(sourceUrl, size = "default", customOptions) {
|
|
|
32151
32451
|
}
|
|
32152
32452
|
|
|
32153
32453
|
// src/mantine/components/Base/CoverImageButton.tsx
|
|
32154
|
-
import
|
|
32155
|
-
import { UnstyledButton as UnstyledButton6, Group as Group106, Text as
|
|
32454
|
+
import React293, { forwardRef, useState as useState134 } from "react";
|
|
32455
|
+
import { UnstyledButton as UnstyledButton6, Group as Group106, Text as Text171 } from "@mantine/core";
|
|
32156
32456
|
var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false, onClick, icon: icon2, children, style }, ref) {
|
|
32157
|
-
const [hovered, setHovered] =
|
|
32158
|
-
return /* @__PURE__ */
|
|
32457
|
+
const [hovered, setHovered] = useState134(false);
|
|
32458
|
+
return /* @__PURE__ */ React293.createElement(
|
|
32159
32459
|
UnstyledButton6,
|
|
32160
32460
|
{
|
|
32161
32461
|
ref,
|
|
@@ -32171,7 +32471,7 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
32171
32471
|
...style
|
|
32172
32472
|
}
|
|
32173
32473
|
},
|
|
32174
|
-
/* @__PURE__ */
|
|
32474
|
+
/* @__PURE__ */ React293.createElement(Group106, { gap: 4, wrap: "nowrap" }, icon2 && /* @__PURE__ */ React293.createElement(
|
|
32175
32475
|
"span",
|
|
32176
32476
|
{
|
|
32177
32477
|
style: {
|
|
@@ -32181,8 +32481,8 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
32181
32481
|
}
|
|
32182
32482
|
},
|
|
32183
32483
|
icon2
|
|
32184
|
-
), /* @__PURE__ */
|
|
32185
|
-
|
|
32484
|
+
), /* @__PURE__ */ React293.createElement(
|
|
32485
|
+
Text171,
|
|
32186
32486
|
{
|
|
32187
32487
|
fz: 12,
|
|
32188
32488
|
style: {
|
|
@@ -32196,9 +32496,9 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
32196
32496
|
});
|
|
32197
32497
|
|
|
32198
32498
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
32199
|
-
import
|
|
32200
|
-
import { TextInput as TextInput7, Tabs as Tabs4, Box as
|
|
32201
|
-
import * as
|
|
32499
|
+
import React294, { useState as useState135, useMemo as useMemo121, useEffect as useEffect109 } from "react";
|
|
32500
|
+
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";
|
|
32501
|
+
import * as TablerIcons2 from "@tabler/icons-react";
|
|
32202
32502
|
import { IconSearch as IconSearch7, IconX as IconX13, IconChevronLeft, IconChevronRight as IconChevronRight13 } from "@tabler/icons-react";
|
|
32203
32503
|
|
|
32204
32504
|
// src/core/services/localStorage.ts
|
|
@@ -32229,28 +32529,28 @@ var localStorageService = {
|
|
|
32229
32529
|
var iconsKey = "editor_recent_icons";
|
|
32230
32530
|
var ICONS_PER_PAGE = 500;
|
|
32231
32531
|
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(
|
|
32532
|
+
const [searchQuery, setSearchQuery] = useState135("");
|
|
32533
|
+
const [activeTab, setActiveTab] = useState135("icons");
|
|
32534
|
+
const [currentPage, setCurrentPage] = useState135(1);
|
|
32535
|
+
const allIcons = useMemo121(() => {
|
|
32536
|
+
const iconEntries = Object.entries(TablerIcons2).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
32237
32537
|
return iconEntries;
|
|
32238
32538
|
}, []);
|
|
32239
|
-
const filteredIcons =
|
|
32539
|
+
const filteredIcons = useMemo121(() => {
|
|
32240
32540
|
if (!searchQuery) return allIcons;
|
|
32241
32541
|
const query = searchQuery.toLowerCase();
|
|
32242
32542
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
32243
32543
|
}, [allIcons, searchQuery]);
|
|
32244
|
-
|
|
32544
|
+
useEffect109(() => {
|
|
32245
32545
|
setCurrentPage(1);
|
|
32246
32546
|
}, [searchQuery]);
|
|
32247
|
-
const paginatedIcons =
|
|
32547
|
+
const paginatedIcons = useMemo121(() => {
|
|
32248
32548
|
const startIndex = (currentPage - 1) * ICONS_PER_PAGE;
|
|
32249
32549
|
const endIndex = startIndex + ICONS_PER_PAGE;
|
|
32250
32550
|
return filteredIcons.slice(startIndex, endIndex);
|
|
32251
32551
|
}, [filteredIcons, currentPage]);
|
|
32252
32552
|
const totalPages = Math.ceil(filteredIcons.length / ICONS_PER_PAGE);
|
|
32253
|
-
const recentIcons =
|
|
32553
|
+
const recentIcons = useMemo121(() => {
|
|
32254
32554
|
const recentIconNames = localStorageService.get(iconsKey);
|
|
32255
32555
|
if (!recentIconNames || recentIconNames.length === 0) return [];
|
|
32256
32556
|
return recentIconNames.slice(0, 24).map((iconName) => allIcons.find(([name]) => name === iconName)).filter((entry) => entry !== void 0);
|
|
@@ -32265,10 +32565,10 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32265
32565
|
};
|
|
32266
32566
|
const renderIconGrid = (icons) => {
|
|
32267
32567
|
if (icons.length === 0) {
|
|
32268
|
-
return /* @__PURE__ */
|
|
32568
|
+
return /* @__PURE__ */ React294.createElement(Center14, { py: "xl" }, /* @__PURE__ */ React294.createElement(Text172, { c: "dimmed", size: "sm" }, "No icons found"));
|
|
32269
32569
|
}
|
|
32270
|
-
return /* @__PURE__ */
|
|
32271
|
-
|
|
32570
|
+
return /* @__PURE__ */ React294.createElement(
|
|
32571
|
+
Box60,
|
|
32272
32572
|
{
|
|
32273
32573
|
style: {
|
|
32274
32574
|
display: "grid",
|
|
@@ -32279,7 +32579,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32279
32579
|
},
|
|
32280
32580
|
icons.map(([name, IconComponent]) => {
|
|
32281
32581
|
const isSelected = currentIcon === name.replace("Icon", "").replace(/([A-Z])/g, "-$1").toLowerCase().slice(1);
|
|
32282
|
-
return /* @__PURE__ */
|
|
32582
|
+
return /* @__PURE__ */ React294.createElement(
|
|
32283
32583
|
UnstyledButton7,
|
|
32284
32584
|
{
|
|
32285
32585
|
key: name,
|
|
@@ -32305,12 +32605,12 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32305
32605
|
}
|
|
32306
32606
|
}
|
|
32307
32607
|
},
|
|
32308
|
-
/* @__PURE__ */
|
|
32608
|
+
/* @__PURE__ */ React294.createElement(IconComponent, { size: 24, stroke: 1.5, style: { color: "var(--mantine-color-neutralColor-8) !important" } })
|
|
32309
32609
|
);
|
|
32310
32610
|
})
|
|
32311
32611
|
);
|
|
32312
32612
|
};
|
|
32313
|
-
return /* @__PURE__ */
|
|
32613
|
+
return /* @__PURE__ */ React294.createElement(Popover6, { opened, onClose, position: "right", width: 500, shadow: "xl" }, /* @__PURE__ */ React294.createElement(Popover6.Target, null, children), /* @__PURE__ */ React294.createElement(
|
|
32314
32614
|
Popover6.Dropdown,
|
|
32315
32615
|
{
|
|
32316
32616
|
style: {
|
|
@@ -32320,7 +32620,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32320
32620
|
},
|
|
32321
32621
|
p: 0
|
|
32322
32622
|
},
|
|
32323
|
-
onRemove && /* @__PURE__ */
|
|
32623
|
+
onRemove && /* @__PURE__ */ React294.createElement(
|
|
32324
32624
|
UnstyledButton7,
|
|
32325
32625
|
{
|
|
32326
32626
|
onClick: () => {
|
|
@@ -32338,17 +32638,17 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32338
32638
|
transition: "background 0.15s ease"
|
|
32339
32639
|
}
|
|
32340
32640
|
},
|
|
32341
|
-
/* @__PURE__ */
|
|
32641
|
+
/* @__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
32642
|
),
|
|
32343
|
-
/* @__PURE__ */
|
|
32643
|
+
/* @__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
32644
|
TextInput7,
|
|
32345
32645
|
{
|
|
32346
32646
|
mb: "md",
|
|
32347
32647
|
placeholder: "Filter",
|
|
32348
|
-
leftSection: /* @__PURE__ */
|
|
32648
|
+
leftSection: /* @__PURE__ */ React294.createElement(IconSearch7, { size: 18 }),
|
|
32349
32649
|
value: searchQuery,
|
|
32350
32650
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
32351
|
-
rightSection: searchQuery && /* @__PURE__ */
|
|
32651
|
+
rightSection: searchQuery && /* @__PURE__ */ React294.createElement(UnstyledButton7, { onClick: () => setSearchQuery("") }, /* @__PURE__ */ React294.createElement(IconX13, { size: 18 })),
|
|
32352
32652
|
style: { flex: 1 },
|
|
32353
32653
|
styles: {
|
|
32354
32654
|
input: {
|
|
@@ -32358,37 +32658,37 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32358
32658
|
}
|
|
32359
32659
|
}
|
|
32360
32660
|
}
|
|
32361
|
-
), !searchQuery && /* @__PURE__ */
|
|
32661
|
+
), !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
32662
|
BaseButton,
|
|
32363
32663
|
{
|
|
32364
32664
|
size: "xs",
|
|
32365
32665
|
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
32366
32666
|
disabled: currentPage === totalPages,
|
|
32367
|
-
leftSection: /* @__PURE__ */
|
|
32667
|
+
leftSection: /* @__PURE__ */ React294.createElement(IconChevronRight13, { size: 14 })
|
|
32368
32668
|
},
|
|
32369
32669
|
"Next"
|
|
32370
|
-
))), /* @__PURE__ */
|
|
32670
|
+
))), /* @__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
32671
|
));
|
|
32372
32672
|
}
|
|
32373
32673
|
|
|
32374
32674
|
// src/mantine/components/Base/PageIcon.tsx
|
|
32375
|
-
import
|
|
32376
|
-
import { Center as Center15, Box as
|
|
32377
|
-
import * as
|
|
32675
|
+
import React295, { useMemo as useMemo122 } from "react";
|
|
32676
|
+
import { Center as Center15, Box as Box61 } from "@mantine/core";
|
|
32677
|
+
import * as TablerIcons3 from "@tabler/icons-react";
|
|
32378
32678
|
function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
32379
32679
|
const isIconName = src && !src.startsWith("http");
|
|
32380
|
-
const IconComponent =
|
|
32680
|
+
const IconComponent = useMemo122(() => {
|
|
32381
32681
|
if (!isIconName || !src) return null;
|
|
32382
|
-
const iconComponent =
|
|
32682
|
+
const iconComponent = TablerIcons3[src];
|
|
32383
32683
|
if (iconComponent) {
|
|
32384
32684
|
return iconComponent;
|
|
32385
32685
|
}
|
|
32386
32686
|
return null;
|
|
32387
32687
|
}, [isIconName, src]);
|
|
32388
|
-
const Container = useCenter ? Center15 :
|
|
32688
|
+
const Container = useCenter ? Center15 : Box61;
|
|
32389
32689
|
if (!src) return null;
|
|
32390
32690
|
if (IconComponent) {
|
|
32391
|
-
return /* @__PURE__ */
|
|
32691
|
+
return /* @__PURE__ */ React295.createElement(
|
|
32392
32692
|
Container,
|
|
32393
32693
|
{
|
|
32394
32694
|
style: {
|
|
@@ -32400,10 +32700,10 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
32400
32700
|
...style
|
|
32401
32701
|
}
|
|
32402
32702
|
},
|
|
32403
|
-
/* @__PURE__ */
|
|
32703
|
+
/* @__PURE__ */ React295.createElement(IconComponent, { size: iconSize, stroke: 1.5, style: { color: "var(--mantine-color-neutralColor-8) !important" } })
|
|
32404
32704
|
);
|
|
32405
32705
|
}
|
|
32406
|
-
return /* @__PURE__ */
|
|
32706
|
+
return /* @__PURE__ */ React295.createElement(
|
|
32407
32707
|
"img",
|
|
32408
32708
|
{
|
|
32409
32709
|
src,
|
|
@@ -32424,14 +32724,14 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
32424
32724
|
import { useDisclosure as useDisclosure7 } from "@mantine/hooks";
|
|
32425
32725
|
|
|
32426
32726
|
// src/mantine/components/FlowSettingsPanel.tsx
|
|
32427
|
-
import
|
|
32428
|
-
import { Stack as
|
|
32727
|
+
import React296, { useState as useState136, useEffect as useEffect110, useCallback as useCallback110 } from "react";
|
|
32728
|
+
import { Stack as Stack198, Group as Group108, Button as Button55, ActionIcon as ActionIcon37, Text as Text173, Box as Box62 } from "@mantine/core";
|
|
32429
32729
|
import { IconPlus as IconPlus10, IconTrash as IconTrash10 } from "@tabler/icons-react";
|
|
32430
32730
|
var SYSTEM_KEYS = /* @__PURE__ */ new Set(["@context", "_type", "schema_version", "doc_id", "title", "createdAt", "createdBy", "flowOwnerDid"]);
|
|
32431
32731
|
var FlowSettingsPanel = ({ editor }) => {
|
|
32432
32732
|
const { closePanel } = usePanelStore();
|
|
32433
|
-
const [rows, setRows] =
|
|
32434
|
-
const loadSettings =
|
|
32733
|
+
const [rows, setRows] = useState136([]);
|
|
32734
|
+
const loadSettings = useCallback110(() => {
|
|
32435
32735
|
const metadata = editor.getFlowMetadata?.();
|
|
32436
32736
|
if (!metadata) return;
|
|
32437
32737
|
const customRows = [];
|
|
@@ -32442,10 +32742,10 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
32442
32742
|
}
|
|
32443
32743
|
setRows(customRows);
|
|
32444
32744
|
}, [editor]);
|
|
32445
|
-
|
|
32745
|
+
useEffect110(() => {
|
|
32446
32746
|
loadSettings();
|
|
32447
32747
|
}, [loadSettings]);
|
|
32448
|
-
const handleKeyChange =
|
|
32748
|
+
const handleKeyChange = useCallback110(
|
|
32449
32749
|
(index, newKey) => {
|
|
32450
32750
|
setRows((prev) => {
|
|
32451
32751
|
const updated = [...prev];
|
|
@@ -32462,7 +32762,7 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
32462
32762
|
},
|
|
32463
32763
|
[editor]
|
|
32464
32764
|
);
|
|
32465
|
-
const handleValueChange =
|
|
32765
|
+
const handleValueChange = useCallback110(
|
|
32466
32766
|
(index, newValue) => {
|
|
32467
32767
|
setRows((prev) => {
|
|
32468
32768
|
const updated = [...prev];
|
|
@@ -32476,10 +32776,10 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
32476
32776
|
},
|
|
32477
32777
|
[editor]
|
|
32478
32778
|
);
|
|
32479
|
-
const handleAdd =
|
|
32779
|
+
const handleAdd = useCallback110(() => {
|
|
32480
32780
|
setRows((prev) => [...prev, { key: "", value: "" }]);
|
|
32481
32781
|
}, []);
|
|
32482
|
-
const handleDelete =
|
|
32782
|
+
const handleDelete = useCallback110(
|
|
32483
32783
|
(index) => {
|
|
32484
32784
|
setRows((prev) => {
|
|
32485
32785
|
const row = prev[index];
|
|
@@ -32491,23 +32791,23 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
32491
32791
|
},
|
|
32492
32792
|
[editor]
|
|
32493
32793
|
);
|
|
32494
|
-
const subtitle = /* @__PURE__ */
|
|
32495
|
-
return /* @__PURE__ */
|
|
32794
|
+
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."));
|
|
32795
|
+
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
32796
|
};
|
|
32497
32797
|
|
|
32498
32798
|
// src/mantine/components/CoverImage.tsx
|
|
32499
32799
|
function CoverImage({ coverImageUrl, logoUrl }) {
|
|
32500
32800
|
const { editor, handlers, editable } = useBlocknoteContext();
|
|
32501
|
-
const [isHovering, setIsHovering] =
|
|
32502
|
-
const [isRepositioning, setIsRepositioning] =
|
|
32503
|
-
const [coverPosition, setCoverPosition] =
|
|
32504
|
-
const coverFileInputRef =
|
|
32505
|
-
const logoFileInputRef =
|
|
32801
|
+
const [isHovering, setIsHovering] = useState137(false);
|
|
32802
|
+
const [isRepositioning, setIsRepositioning] = useState137(false);
|
|
32803
|
+
const [coverPosition, setCoverPosition] = useState137(() => editor?.getPageMetadata?.()?.coverPosition ?? 50);
|
|
32804
|
+
const coverFileInputRef = useRef30(null);
|
|
32805
|
+
const logoFileInputRef = useRef30(null);
|
|
32506
32806
|
const [opened, { open, close }] = useDisclosure7(false);
|
|
32507
|
-
const [metadata, setMetadata] =
|
|
32508
|
-
const settingsPanelContent =
|
|
32807
|
+
const [metadata, setMetadata] = useState137(() => editor?.getPageMetadata?.() || null);
|
|
32808
|
+
const settingsPanelContent = useMemo123(() => editor ? /* @__PURE__ */ React297.createElement(FlowSettingsPanel, { editor }) : null, [editor]);
|
|
32509
32809
|
const { open: openSettings } = usePanel("flow-settings-panel", settingsPanelContent);
|
|
32510
|
-
|
|
32810
|
+
useEffect111(() => {
|
|
32511
32811
|
if (!editor?._metadataManager) {
|
|
32512
32812
|
return;
|
|
32513
32813
|
}
|
|
@@ -32595,8 +32895,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32595
32895
|
return null;
|
|
32596
32896
|
}
|
|
32597
32897
|
if (!hasCover) {
|
|
32598
|
-
return /* @__PURE__ */
|
|
32599
|
-
|
|
32898
|
+
return /* @__PURE__ */ React297.createElement(
|
|
32899
|
+
Box63,
|
|
32600
32900
|
{
|
|
32601
32901
|
style: {
|
|
32602
32902
|
position: "relative",
|
|
@@ -32607,8 +32907,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32607
32907
|
onMouseEnter: () => editable && setIsHovering(true),
|
|
32608
32908
|
onMouseLeave: () => editable && setIsHovering(false)
|
|
32609
32909
|
},
|
|
32610
|
-
/* @__PURE__ */
|
|
32611
|
-
|
|
32910
|
+
/* @__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(
|
|
32911
|
+
Box63,
|
|
32612
32912
|
{
|
|
32613
32913
|
style: {
|
|
32614
32914
|
position: "relative",
|
|
@@ -32620,8 +32920,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32620
32920
|
zIndex: 11
|
|
32621
32921
|
}
|
|
32622
32922
|
},
|
|
32623
|
-
/* @__PURE__ */
|
|
32624
|
-
editable && /* @__PURE__ */
|
|
32923
|
+
/* @__PURE__ */ React297.createElement(PageIcon, { src: logoSrc, useCenter: true, iconSize: 64 }),
|
|
32924
|
+
editable && /* @__PURE__ */ React297.createElement(
|
|
32625
32925
|
BaseIconPicker,
|
|
32626
32926
|
{
|
|
32627
32927
|
opened,
|
|
@@ -32631,8 +32931,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32631
32931
|
onUploadClick: () => logoFileInputRef.current?.click(),
|
|
32632
32932
|
onRemove: handleRemoveLogo
|
|
32633
32933
|
},
|
|
32634
|
-
/* @__PURE__ */
|
|
32635
|
-
|
|
32934
|
+
/* @__PURE__ */ React297.createElement(
|
|
32935
|
+
Box63,
|
|
32636
32936
|
{
|
|
32637
32937
|
onClick: open,
|
|
32638
32938
|
style: {
|
|
@@ -32644,7 +32944,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32644
32944
|
}
|
|
32645
32945
|
)
|
|
32646
32946
|
)
|
|
32647
|
-
), editable && (isHovering || opened) && /* @__PURE__ */
|
|
32947
|
+
), 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
32948
|
BaseIconPicker,
|
|
32649
32949
|
{
|
|
32650
32950
|
opened,
|
|
@@ -32653,12 +32953,12 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32653
32953
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
32654
32954
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
32655
32955
|
},
|
|
32656
|
-
/* @__PURE__ */
|
|
32657
|
-
), /* @__PURE__ */
|
|
32956
|
+
/* @__PURE__ */ React297.createElement(CoverImageButton, { onClick: open, icon: /* @__PURE__ */ React297.createElement(IconMoodSmile, { size: 14 }) }, "Add icon")
|
|
32957
|
+
), /* @__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
32958
|
);
|
|
32659
32959
|
}
|
|
32660
|
-
return /* @__PURE__ */
|
|
32661
|
-
|
|
32960
|
+
return /* @__PURE__ */ React297.createElement(
|
|
32961
|
+
Box63,
|
|
32662
32962
|
{
|
|
32663
32963
|
style: {
|
|
32664
32964
|
position: "relative",
|
|
@@ -32685,7 +32985,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32685
32985
|
}
|
|
32686
32986
|
}
|
|
32687
32987
|
},
|
|
32688
|
-
/* @__PURE__ */
|
|
32988
|
+
/* @__PURE__ */ React297.createElement(
|
|
32689
32989
|
"img",
|
|
32690
32990
|
{
|
|
32691
32991
|
src: coverUrl,
|
|
@@ -32703,7 +33003,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32703
33003
|
}
|
|
32704
33004
|
}
|
|
32705
33005
|
),
|
|
32706
|
-
editable && isHovering && /* @__PURE__ */
|
|
33006
|
+
editable && isHovering && /* @__PURE__ */ React297.createElement(
|
|
32707
33007
|
Group109,
|
|
32708
33008
|
{
|
|
32709
33009
|
gap: "xs",
|
|
@@ -32714,8 +33014,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32714
33014
|
zIndex: 10
|
|
32715
33015
|
}
|
|
32716
33016
|
},
|
|
32717
|
-
/* @__PURE__ */
|
|
32718
|
-
/* @__PURE__ */
|
|
33017
|
+
/* @__PURE__ */ React297.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click(), icon: /* @__PURE__ */ React297.createElement(IconRefresh5, { size: 14 }) }, "Change cover"),
|
|
33018
|
+
/* @__PURE__ */ React297.createElement(
|
|
32719
33019
|
CoverImageButton,
|
|
32720
33020
|
{
|
|
32721
33021
|
onClick: () => {
|
|
@@ -32725,14 +33025,14 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32725
33025
|
setIsRepositioning(!isRepositioning);
|
|
32726
33026
|
},
|
|
32727
33027
|
isActive: isRepositioning,
|
|
32728
|
-
icon: /* @__PURE__ */
|
|
33028
|
+
icon: /* @__PURE__ */ React297.createElement(IconArrowsMove, { size: 14 })
|
|
32729
33029
|
},
|
|
32730
33030
|
isRepositioning ? "Done" : "Reposition"
|
|
32731
33031
|
),
|
|
32732
|
-
/* @__PURE__ */
|
|
33032
|
+
/* @__PURE__ */ React297.createElement(CoverImageButton, { onClick: handleRemoveCover, icon: /* @__PURE__ */ React297.createElement(IconTrash11, { size: 14 }) }, "Remove")
|
|
32733
33033
|
),
|
|
32734
|
-
/* @__PURE__ */
|
|
32735
|
-
|
|
33034
|
+
/* @__PURE__ */ React297.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: 0, right: 0, height: "70px" } }, /* @__PURE__ */ React297.createElement(
|
|
33035
|
+
Box63,
|
|
32736
33036
|
{
|
|
32737
33037
|
style: {
|
|
32738
33038
|
position: "absolute",
|
|
@@ -32743,7 +33043,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32743
33043
|
zIndex: 11
|
|
32744
33044
|
}
|
|
32745
33045
|
},
|
|
32746
|
-
logoSrc ? /* @__PURE__ */
|
|
33046
|
+
logoSrc ? /* @__PURE__ */ React297.createElement(React297.Fragment, null, /* @__PURE__ */ React297.createElement(PageIcon, { src: logoSrc, useCenter: true, iconSize: 64 }), editable && /* @__PURE__ */ React297.createElement(
|
|
32747
33047
|
BaseIconPicker,
|
|
32748
33048
|
{
|
|
32749
33049
|
opened,
|
|
@@ -32753,8 +33053,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32753
33053
|
onUploadClick: () => logoFileInputRef.current?.click(),
|
|
32754
33054
|
onRemove: handleRemoveLogo
|
|
32755
33055
|
},
|
|
32756
|
-
/* @__PURE__ */
|
|
32757
|
-
|
|
33056
|
+
/* @__PURE__ */ React297.createElement(
|
|
33057
|
+
Box63,
|
|
32758
33058
|
{
|
|
32759
33059
|
onClick: open,
|
|
32760
33060
|
style: {
|
|
@@ -32765,7 +33065,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32765
33065
|
}
|
|
32766
33066
|
}
|
|
32767
33067
|
)
|
|
32768
|
-
)) : editable && isHovering && /* @__PURE__ */
|
|
33068
|
+
)) : editable && isHovering && /* @__PURE__ */ React297.createElement(
|
|
32769
33069
|
BaseIconPicker,
|
|
32770
33070
|
{
|
|
32771
33071
|
opened,
|
|
@@ -32774,11 +33074,11 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32774
33074
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
32775
33075
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
32776
33076
|
},
|
|
32777
|
-
/* @__PURE__ */
|
|
33077
|
+
/* @__PURE__ */ React297.createElement(
|
|
32778
33078
|
CoverImageButton,
|
|
32779
33079
|
{
|
|
32780
33080
|
onClick: open,
|
|
32781
|
-
icon: /* @__PURE__ */
|
|
33081
|
+
icon: /* @__PURE__ */ React297.createElement(IconMoodSmile, { size: 14 }),
|
|
32782
33082
|
style: {
|
|
32783
33083
|
position: "absolute",
|
|
32784
33084
|
top: "50%",
|
|
@@ -32791,14 +33091,14 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32791
33091
|
)
|
|
32792
33092
|
)
|
|
32793
33093
|
)),
|
|
32794
|
-
/* @__PURE__ */
|
|
32795
|
-
/* @__PURE__ */
|
|
33094
|
+
/* @__PURE__ */ React297.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
|
|
33095
|
+
/* @__PURE__ */ React297.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") })
|
|
32796
33096
|
);
|
|
32797
33097
|
}
|
|
32798
33098
|
|
|
32799
33099
|
// src/mantine/components/PageTitle.tsx
|
|
32800
|
-
import
|
|
32801
|
-
import { Box as
|
|
33100
|
+
import React298, { useState as useState138, useEffect as useEffect112, useRef as useRef31, useCallback as useCallback111 } from "react";
|
|
33101
|
+
import { Box as Box64 } from "@mantine/core";
|
|
32802
33102
|
var DEFAULT_TITLE = "New page";
|
|
32803
33103
|
function isUserTitle(name) {
|
|
32804
33104
|
if (!name) return "";
|
|
@@ -32813,11 +33113,11 @@ function cleanEmptyEditable(el) {
|
|
|
32813
33113
|
}
|
|
32814
33114
|
}
|
|
32815
33115
|
function PageTitle({ editor, editable }) {
|
|
32816
|
-
const [title, setTitle] =
|
|
32817
|
-
const [hasIcon, setHasIcon] =
|
|
32818
|
-
const titleRef =
|
|
32819
|
-
const isComposing =
|
|
32820
|
-
|
|
33116
|
+
const [title, setTitle] = useState138("");
|
|
33117
|
+
const [hasIcon, setHasIcon] = useState138(false);
|
|
33118
|
+
const titleRef = useRef31(null);
|
|
33119
|
+
const isComposing = useRef31(false);
|
|
33120
|
+
useEffect112(() => {
|
|
32821
33121
|
if (!editor?._metadataManager) return;
|
|
32822
33122
|
const metadata = editor._metadataManager.getMetadata();
|
|
32823
33123
|
const initial = isUserTitle(metadata?.title);
|
|
@@ -32837,12 +33137,12 @@ function PageTitle({ editor, editable }) {
|
|
|
32837
33137
|
});
|
|
32838
33138
|
return unsubscribe;
|
|
32839
33139
|
}, [editor]);
|
|
32840
|
-
|
|
33140
|
+
useEffect112(() => {
|
|
32841
33141
|
if (titleRef.current && title && !titleRef.current.textContent) {
|
|
32842
33142
|
titleRef.current.textContent = title;
|
|
32843
33143
|
}
|
|
32844
33144
|
}, [title]);
|
|
32845
|
-
const saveTitle =
|
|
33145
|
+
const saveTitle = useCallback111(
|
|
32846
33146
|
async (newTitle) => {
|
|
32847
33147
|
const trimmed = newTitle.trim();
|
|
32848
33148
|
const toSave = trimmed || DEFAULT_TITLE;
|
|
@@ -32858,19 +33158,19 @@ function PageTitle({ editor, editable }) {
|
|
|
32858
33158
|
},
|
|
32859
33159
|
[editor]
|
|
32860
33160
|
);
|
|
32861
|
-
const handleInput =
|
|
33161
|
+
const handleInput = useCallback111(() => {
|
|
32862
33162
|
if (titleRef.current) {
|
|
32863
33163
|
cleanEmptyEditable(titleRef.current);
|
|
32864
33164
|
setTitle(titleRef.current.textContent || "");
|
|
32865
33165
|
}
|
|
32866
33166
|
}, []);
|
|
32867
|
-
const handleBlur =
|
|
33167
|
+
const handleBlur = useCallback111(() => {
|
|
32868
33168
|
if (titleRef.current) {
|
|
32869
33169
|
cleanEmptyEditable(titleRef.current);
|
|
32870
33170
|
saveTitle(titleRef.current.textContent || "");
|
|
32871
33171
|
}
|
|
32872
33172
|
}, [saveTitle]);
|
|
32873
|
-
const handleKeyDown =
|
|
33173
|
+
const handleKeyDown = useCallback111(
|
|
32874
33174
|
(e) => {
|
|
32875
33175
|
if (isComposing.current) return;
|
|
32876
33176
|
if (e.key === "Enter" || e.key === "ArrowDown") {
|
|
@@ -32881,9 +33181,10 @@ function PageTitle({ editor, editable }) {
|
|
|
32881
33181
|
},
|
|
32882
33182
|
[editor, saveTitle]
|
|
32883
33183
|
);
|
|
32884
|
-
|
|
33184
|
+
useEffect112(() => {
|
|
32885
33185
|
const handleEditorKeyDown = (e) => {
|
|
32886
33186
|
if (e.key !== "ArrowUp" || !titleRef.current) return;
|
|
33187
|
+
if (document.getElementById("bn-suggestion-menu")) return;
|
|
32887
33188
|
try {
|
|
32888
33189
|
const pos = editor.getTextCursorPosition?.();
|
|
32889
33190
|
if (pos && !pos.prevBlock) {
|
|
@@ -32904,13 +33205,13 @@ function PageTitle({ editor, editable }) {
|
|
|
32904
33205
|
container?.removeEventListener("keydown", handleEditorKeyDown, true);
|
|
32905
33206
|
};
|
|
32906
33207
|
}, [editor]);
|
|
32907
|
-
const handlePaste =
|
|
33208
|
+
const handlePaste = useCallback111((e) => {
|
|
32908
33209
|
e.preventDefault();
|
|
32909
33210
|
const text = e.clipboardData.getData("text/plain").replace(/\n/g, " ");
|
|
32910
33211
|
document.execCommand("insertText", false, text);
|
|
32911
33212
|
}, []);
|
|
32912
|
-
return /* @__PURE__ */
|
|
32913
|
-
|
|
33213
|
+
return /* @__PURE__ */ React298.createElement(Box64, { maw: 900, mx: "auto", w: "100%" }, /* @__PURE__ */ React298.createElement(
|
|
33214
|
+
Box64,
|
|
32914
33215
|
{
|
|
32915
33216
|
ref: titleRef,
|
|
32916
33217
|
component: "div",
|
|
@@ -32966,8 +33267,8 @@ if (typeof document !== "undefined") {
|
|
|
32966
33267
|
}
|
|
32967
33268
|
|
|
32968
33269
|
// src/mantine/components/ExternalDropZone.tsx
|
|
32969
|
-
import
|
|
32970
|
-
import { Box as
|
|
33270
|
+
import React299, { useCallback as useCallback112, useEffect as useEffect113, useRef as useRef32, useState as useState139 } from "react";
|
|
33271
|
+
import { Box as Box65 } from "@mantine/core";
|
|
32971
33272
|
var SCROLL_ZONE_SIZE = 80;
|
|
32972
33273
|
var SCROLL_SPEED = 12;
|
|
32973
33274
|
var ExternalDropZone = ({
|
|
@@ -32979,20 +33280,20 @@ var ExternalDropZone = ({
|
|
|
32979
33280
|
onPlacementCancel,
|
|
32980
33281
|
children
|
|
32981
33282
|
}) => {
|
|
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 =
|
|
33283
|
+
const containerRef = useRef32(null);
|
|
33284
|
+
const [isValidDrag, setIsValidDrag] = useState139(false);
|
|
33285
|
+
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState139(false);
|
|
33286
|
+
const [indicatorStyle, setIndicatorStyle] = useState139({});
|
|
33287
|
+
const dropPositionRef = useRef32(null);
|
|
33288
|
+
const scrollAnimationRef = useRef32(null);
|
|
33289
|
+
const scrollDirectionRef = useRef32(null);
|
|
33290
|
+
const scrollContainerRef = useRef32(null);
|
|
33291
|
+
const getBlockElements = useCallback112(() => {
|
|
32991
33292
|
if (!containerRef.current) return [];
|
|
32992
33293
|
const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
|
|
32993
33294
|
return Array.from(blocks);
|
|
32994
33295
|
}, []);
|
|
32995
|
-
const getScrollContainer =
|
|
33296
|
+
const getScrollContainer = useCallback112(() => {
|
|
32996
33297
|
if (scrollContainerRef.current) return scrollContainerRef.current;
|
|
32997
33298
|
let element = containerRef.current;
|
|
32998
33299
|
while (element) {
|
|
@@ -33007,7 +33308,7 @@ var ExternalDropZone = ({
|
|
|
33007
33308
|
scrollContainerRef.current = window;
|
|
33008
33309
|
return window;
|
|
33009
33310
|
}, []);
|
|
33010
|
-
const performScroll =
|
|
33311
|
+
const performScroll = useCallback112(() => {
|
|
33011
33312
|
const container = getScrollContainer();
|
|
33012
33313
|
const direction = scrollDirectionRef.current;
|
|
33013
33314
|
if (!direction) {
|
|
@@ -33022,7 +33323,7 @@ var ExternalDropZone = ({
|
|
|
33022
33323
|
}
|
|
33023
33324
|
scrollAnimationRef.current = requestAnimationFrame(performScroll);
|
|
33024
33325
|
}, [getScrollContainer]);
|
|
33025
|
-
const startAutoScroll =
|
|
33326
|
+
const startAutoScroll = useCallback112(
|
|
33026
33327
|
(direction) => {
|
|
33027
33328
|
if (scrollDirectionRef.current === direction) return;
|
|
33028
33329
|
scrollDirectionRef.current = direction;
|
|
@@ -33032,14 +33333,14 @@ var ExternalDropZone = ({
|
|
|
33032
33333
|
},
|
|
33033
33334
|
[performScroll]
|
|
33034
33335
|
);
|
|
33035
|
-
const stopAutoScroll =
|
|
33336
|
+
const stopAutoScroll = useCallback112(() => {
|
|
33036
33337
|
scrollDirectionRef.current = null;
|
|
33037
33338
|
if (scrollAnimationRef.current) {
|
|
33038
33339
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
33039
33340
|
scrollAnimationRef.current = null;
|
|
33040
33341
|
}
|
|
33041
33342
|
}, []);
|
|
33042
|
-
const checkAutoScroll =
|
|
33343
|
+
const checkAutoScroll = useCallback112(
|
|
33043
33344
|
(clientY) => {
|
|
33044
33345
|
const container = getScrollContainer();
|
|
33045
33346
|
let containerTop;
|
|
@@ -33062,7 +33363,7 @@ var ExternalDropZone = ({
|
|
|
33062
33363
|
},
|
|
33063
33364
|
[getScrollContainer, startAutoScroll, stopAutoScroll]
|
|
33064
33365
|
);
|
|
33065
|
-
const findDropPosition =
|
|
33366
|
+
const findDropPosition = useCallback112(
|
|
33066
33367
|
(clientY) => {
|
|
33067
33368
|
const blocks = getBlockElements();
|
|
33068
33369
|
if (blocks.length === 0 || !editor?.document) return null;
|
|
@@ -33095,7 +33396,7 @@ var ExternalDropZone = ({
|
|
|
33095
33396
|
},
|
|
33096
33397
|
[getBlockElements, editor]
|
|
33097
33398
|
);
|
|
33098
|
-
const handleDragOver =
|
|
33399
|
+
const handleDragOver = useCallback112(
|
|
33099
33400
|
(e) => {
|
|
33100
33401
|
if (!e.dataTransfer.types.includes(acceptedType)) return;
|
|
33101
33402
|
e.preventDefault();
|
|
@@ -33118,7 +33419,7 @@ var ExternalDropZone = ({
|
|
|
33118
33419
|
},
|
|
33119
33420
|
[acceptedType, findDropPosition, checkAutoScroll]
|
|
33120
33421
|
);
|
|
33121
|
-
const handleDragLeave =
|
|
33422
|
+
const handleDragLeave = useCallback112(
|
|
33122
33423
|
(e) => {
|
|
33123
33424
|
if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) {
|
|
33124
33425
|
setIsValidDrag(false);
|
|
@@ -33128,7 +33429,7 @@ var ExternalDropZone = ({
|
|
|
33128
33429
|
},
|
|
33129
33430
|
[stopAutoScroll]
|
|
33130
33431
|
);
|
|
33131
|
-
const handleDrop =
|
|
33432
|
+
const handleDrop = useCallback112(
|
|
33132
33433
|
(e) => {
|
|
33133
33434
|
e.preventDefault();
|
|
33134
33435
|
e.stopPropagation();
|
|
@@ -33142,7 +33443,7 @@ var ExternalDropZone = ({
|
|
|
33142
33443
|
},
|
|
33143
33444
|
[onDrop, stopAutoScroll]
|
|
33144
33445
|
);
|
|
33145
|
-
|
|
33446
|
+
useEffect113(() => {
|
|
33146
33447
|
const handleGlobalDragEnd = () => {
|
|
33147
33448
|
setIsValidDrag(false);
|
|
33148
33449
|
dropPositionRef.current = null;
|
|
@@ -33151,7 +33452,7 @@ var ExternalDropZone = ({
|
|
|
33151
33452
|
window.addEventListener("dragend", handleGlobalDragEnd);
|
|
33152
33453
|
return () => window.removeEventListener("dragend", handleGlobalDragEnd);
|
|
33153
33454
|
}, [stopAutoScroll]);
|
|
33154
|
-
const handleOverlayMouseMove =
|
|
33455
|
+
const handleOverlayMouseMove = useCallback112(
|
|
33155
33456
|
(e) => {
|
|
33156
33457
|
setIsHoveringInPlacementMode(true);
|
|
33157
33458
|
checkAutoScroll(e.clientY);
|
|
@@ -33170,12 +33471,12 @@ var ExternalDropZone = ({
|
|
|
33170
33471
|
},
|
|
33171
33472
|
[findDropPosition, checkAutoScroll]
|
|
33172
33473
|
);
|
|
33173
|
-
const handleOverlayMouseLeave =
|
|
33474
|
+
const handleOverlayMouseLeave = useCallback112(() => {
|
|
33174
33475
|
setIsHoveringInPlacementMode(false);
|
|
33175
33476
|
dropPositionRef.current = null;
|
|
33176
33477
|
stopAutoScroll();
|
|
33177
33478
|
}, [stopAutoScroll]);
|
|
33178
|
-
const handleOverlayClick =
|
|
33479
|
+
const handleOverlayClick = useCallback112(
|
|
33179
33480
|
(e) => {
|
|
33180
33481
|
e.preventDefault();
|
|
33181
33482
|
e.stopPropagation();
|
|
@@ -33189,7 +33490,7 @@ var ExternalDropZone = ({
|
|
|
33189
33490
|
},
|
|
33190
33491
|
[onDrop, stopAutoScroll]
|
|
33191
33492
|
);
|
|
33192
|
-
const handleOverlayWheel =
|
|
33493
|
+
const handleOverlayWheel = useCallback112(
|
|
33193
33494
|
(e) => {
|
|
33194
33495
|
const container = getScrollContainer();
|
|
33195
33496
|
if (container === window) {
|
|
@@ -33200,7 +33501,7 @@ var ExternalDropZone = ({
|
|
|
33200
33501
|
},
|
|
33201
33502
|
[getScrollContainer]
|
|
33202
33503
|
);
|
|
33203
|
-
|
|
33504
|
+
useEffect113(() => {
|
|
33204
33505
|
if (!isPlacementMode) return;
|
|
33205
33506
|
const handleKeyDown = (e) => {
|
|
33206
33507
|
if (e.key === "Escape") {
|
|
@@ -33223,13 +33524,13 @@ var ExternalDropZone = ({
|
|
|
33223
33524
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
33224
33525
|
};
|
|
33225
33526
|
}, [isPlacementMode, onPlacementCancel]);
|
|
33226
|
-
|
|
33527
|
+
useEffect113(() => {
|
|
33227
33528
|
if (!isPlacementMode) {
|
|
33228
33529
|
setIsHoveringInPlacementMode(false);
|
|
33229
33530
|
dropPositionRef.current = null;
|
|
33230
33531
|
}
|
|
33231
33532
|
}, [isPlacementMode]);
|
|
33232
|
-
|
|
33533
|
+
useEffect113(() => {
|
|
33233
33534
|
const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
33234
33535
|
if (isActive) {
|
|
33235
33536
|
document.body.classList.add("external-artifact-drag-active");
|
|
@@ -33240,19 +33541,19 @@ var ExternalDropZone = ({
|
|
|
33240
33541
|
document.body.classList.remove("external-artifact-drag-active");
|
|
33241
33542
|
};
|
|
33242
33543
|
}, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
|
|
33243
|
-
|
|
33544
|
+
useEffect113(() => {
|
|
33244
33545
|
return () => {
|
|
33245
33546
|
if (scrollAnimationRef.current) {
|
|
33246
33547
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
33247
33548
|
}
|
|
33248
33549
|
};
|
|
33249
33550
|
}, []);
|
|
33250
|
-
const indicatorWithPosition = dropIndicator &&
|
|
33551
|
+
const indicatorWithPosition = dropIndicator && React299.isValidElement(dropIndicator) ? React299.cloneElement(dropIndicator, {
|
|
33251
33552
|
indicatorTop: typeof indicatorStyle.top === "number" ? indicatorStyle.top : void 0
|
|
33252
33553
|
}) : dropIndicator;
|
|
33253
33554
|
const shouldShowIndicator = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
33254
|
-
return /* @__PURE__ */
|
|
33255
|
-
|
|
33555
|
+
return /* @__PURE__ */ React299.createElement(
|
|
33556
|
+
Box65,
|
|
33256
33557
|
{
|
|
33257
33558
|
ref: containerRef,
|
|
33258
33559
|
style: {
|
|
@@ -33267,8 +33568,8 @@ var ExternalDropZone = ({
|
|
|
33267
33568
|
"data-placement-mode": isPlacementMode ? "true" : void 0
|
|
33268
33569
|
},
|
|
33269
33570
|
children,
|
|
33270
|
-
isPlacementMode && /* @__PURE__ */
|
|
33271
|
-
|
|
33571
|
+
isPlacementMode && /* @__PURE__ */ React299.createElement(
|
|
33572
|
+
Box65,
|
|
33272
33573
|
{
|
|
33273
33574
|
style: {
|
|
33274
33575
|
position: "absolute",
|
|
@@ -33287,11 +33588,29 @@ var ExternalDropZone = ({
|
|
|
33287
33588
|
onWheel: handleOverlayWheel
|
|
33288
33589
|
}
|
|
33289
33590
|
),
|
|
33290
|
-
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */
|
|
33591
|
+
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React299.createElement(Box65, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
|
|
33291
33592
|
);
|
|
33292
33593
|
};
|
|
33293
33594
|
|
|
33294
33595
|
// src/mantine/IxoEditor.tsx
|
|
33596
|
+
var DEFAULT_ICON_MAP = {
|
|
33597
|
+
"Heading 1": icon(IconH1),
|
|
33598
|
+
"Heading 2": icon(IconH2),
|
|
33599
|
+
"Heading 3": icon(IconH3),
|
|
33600
|
+
Quote: icon(IconBlockquote),
|
|
33601
|
+
"Numbered List": icon(IconListNumbers),
|
|
33602
|
+
"Bullet List": icon(IconList2),
|
|
33603
|
+
"Check List": icon(IconListCheck),
|
|
33604
|
+
Paragraph: icon(IconPilcrow),
|
|
33605
|
+
"Code Block": icon(IconCode4),
|
|
33606
|
+
Table: icon(IconTable2),
|
|
33607
|
+
Image: icon(IconPhoto5),
|
|
33608
|
+
Video: icon(IconVideo),
|
|
33609
|
+
Audio: icon(IconVolume),
|
|
33610
|
+
File: icon(IconFile5),
|
|
33611
|
+
Emoji: icon(IconMoodSmile2),
|
|
33612
|
+
"Page Break": icon(IconPageBreak)
|
|
33613
|
+
};
|
|
33295
33614
|
function IxoEditorContent({
|
|
33296
33615
|
editor,
|
|
33297
33616
|
config,
|
|
@@ -33311,7 +33630,7 @@ function IxoEditorContent({
|
|
|
33311
33630
|
}) {
|
|
33312
33631
|
const { activePanel } = usePanelStore();
|
|
33313
33632
|
const isPanelOpen = activePanel !== null;
|
|
33314
|
-
const editorContent = /* @__PURE__ */
|
|
33633
|
+
const editorContent = /* @__PURE__ */ React300.createElement(
|
|
33315
33634
|
BlockNoteView,
|
|
33316
33635
|
{
|
|
33317
33636
|
editor,
|
|
@@ -33326,17 +33645,24 @@ function IxoEditorContent({
|
|
|
33326
33645
|
onChange,
|
|
33327
33646
|
onSelectionChange
|
|
33328
33647
|
},
|
|
33329
|
-
config.slashMenu && /* @__PURE__ */
|
|
33648
|
+
config.slashMenu && /* @__PURE__ */ React300.createElement(
|
|
33330
33649
|
SuggestionMenuController,
|
|
33331
33650
|
{
|
|
33332
33651
|
triggerCharacter: "/",
|
|
33652
|
+
suggestionMenuComponent: CommandPalette,
|
|
33333
33653
|
getItems: async (query) => {
|
|
33334
33654
|
const customItems = getExtraSlashMenuItems(editor);
|
|
33335
|
-
const
|
|
33655
|
+
const defaultItems = getDefaultReactSlashMenuItems(editor).map((item) => ({
|
|
33656
|
+
...item,
|
|
33657
|
+
icon: DEFAULT_ICON_MAP[item.title] ?? item.icon
|
|
33658
|
+
}));
|
|
33659
|
+
const allItems = [...defaultItems, ...customItems];
|
|
33336
33660
|
allItems.sort((a, b) => {
|
|
33337
33661
|
const groupA = a.group || "";
|
|
33338
33662
|
const groupB = b.group || "";
|
|
33339
|
-
|
|
33663
|
+
const orderA = GROUP_ORDER[groupA] ?? 99;
|
|
33664
|
+
const orderB = GROUP_ORDER[groupB] ?? 99;
|
|
33665
|
+
return orderA - orderB;
|
|
33340
33666
|
});
|
|
33341
33667
|
return filterSuggestionItems(allItems, query);
|
|
33342
33668
|
}
|
|
@@ -33344,7 +33670,7 @@ function IxoEditorContent({
|
|
|
33344
33670
|
),
|
|
33345
33671
|
children
|
|
33346
33672
|
);
|
|
33347
|
-
return /* @__PURE__ */
|
|
33673
|
+
return /* @__PURE__ */ React300.createElement("div", { style: { display: "flex", height: "100%", width: "100%", gap: 0 } }, /* @__PURE__ */ React300.createElement(
|
|
33348
33674
|
"div",
|
|
33349
33675
|
{
|
|
33350
33676
|
className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`,
|
|
@@ -33353,9 +33679,9 @@ function IxoEditorContent({
|
|
|
33353
33679
|
transition: "width 0.2s ease"
|
|
33354
33680
|
}
|
|
33355
33681
|
},
|
|
33356
|
-
/* @__PURE__ */
|
|
33357
|
-
/* @__PURE__ */
|
|
33358
|
-
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */
|
|
33682
|
+
/* @__PURE__ */ React300.createElement(CoverImage, { coverImageUrl, logoUrl }),
|
|
33683
|
+
/* @__PURE__ */ React300.createElement(PageTitle, { editor, editable: isEditable }),
|
|
33684
|
+
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */ React300.createElement(
|
|
33359
33685
|
ExternalDropZone,
|
|
33360
33686
|
{
|
|
33361
33687
|
editor,
|
|
@@ -33368,7 +33694,7 @@ function IxoEditorContent({
|
|
|
33368
33694
|
},
|
|
33369
33695
|
editorContent
|
|
33370
33696
|
) : editorContent
|
|
33371
|
-
), isPanelVisible && /* @__PURE__ */
|
|
33697
|
+
), isPanelVisible && /* @__PURE__ */ React300.createElement(PanelContent, { theme: config.theme }));
|
|
33372
33698
|
}
|
|
33373
33699
|
function IxoEditor({
|
|
33374
33700
|
editor,
|
|
@@ -33409,7 +33735,7 @@ function IxoEditor({
|
|
|
33409
33735
|
tableHandles: true
|
|
33410
33736
|
};
|
|
33411
33737
|
const isEditable = editable;
|
|
33412
|
-
const editorContent = /* @__PURE__ */
|
|
33738
|
+
const editorContent = /* @__PURE__ */ React300.createElement(
|
|
33413
33739
|
BlocknoteProvider,
|
|
33414
33740
|
{
|
|
33415
33741
|
editor,
|
|
@@ -33424,7 +33750,7 @@ function IxoEditor({
|
|
|
33424
33750
|
connectedUsers,
|
|
33425
33751
|
awarenessInstance
|
|
33426
33752
|
},
|
|
33427
|
-
/* @__PURE__ */
|
|
33753
|
+
/* @__PURE__ */ React300.createElement(
|
|
33428
33754
|
IxoEditorContent,
|
|
33429
33755
|
{
|
|
33430
33756
|
isPanelVisible,
|
|
@@ -33446,13 +33772,13 @@ function IxoEditor({
|
|
|
33446
33772
|
)
|
|
33447
33773
|
);
|
|
33448
33774
|
if (mantineTheme) {
|
|
33449
|
-
return /* @__PURE__ */
|
|
33775
|
+
return /* @__PURE__ */ React300.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
|
|
33450
33776
|
}
|
|
33451
33777
|
return editorContent;
|
|
33452
33778
|
}
|
|
33453
33779
|
|
|
33454
33780
|
// src/mantine/components/DebugButton.tsx
|
|
33455
|
-
import
|
|
33781
|
+
import React301 from "react";
|
|
33456
33782
|
function DebugButton({ editor }) {
|
|
33457
33783
|
const yMapToObject = (map) => {
|
|
33458
33784
|
if (!map) return null;
|
|
@@ -33479,7 +33805,7 @@ function DebugButton({ editor }) {
|
|
|
33479
33805
|
const json = JSON.stringify(dump, null, 2);
|
|
33480
33806
|
console.log("Editor Debug Dump:\n" + json);
|
|
33481
33807
|
};
|
|
33482
|
-
return /* @__PURE__ */
|
|
33808
|
+
return /* @__PURE__ */ React301.createElement(
|
|
33483
33809
|
"button",
|
|
33484
33810
|
{
|
|
33485
33811
|
onClick: handleClick,
|
|
@@ -33505,7 +33831,7 @@ function DebugButton({ editor }) {
|
|
|
33505
33831
|
}
|
|
33506
33832
|
|
|
33507
33833
|
// src/mantine/components/PageHeader.tsx
|
|
33508
|
-
import
|
|
33834
|
+
import React302, { useState as useState140, useRef as useRef33, useEffect as useEffect114 } from "react";
|
|
33509
33835
|
function PageHeader({
|
|
33510
33836
|
title = "New page",
|
|
33511
33837
|
icon: icon2,
|
|
@@ -33517,11 +33843,11 @@ function PageHeader({
|
|
|
33517
33843
|
isFavorited = false,
|
|
33518
33844
|
menuItems = []
|
|
33519
33845
|
}) {
|
|
33520
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
33521
|
-
const [isPrivacyOpen, setIsPrivacyOpen] =
|
|
33522
|
-
const menuRef =
|
|
33523
|
-
const privacyRef =
|
|
33524
|
-
|
|
33846
|
+
const [isMenuOpen, setIsMenuOpen] = useState140(false);
|
|
33847
|
+
const [isPrivacyOpen, setIsPrivacyOpen] = useState140(false);
|
|
33848
|
+
const menuRef = useRef33(null);
|
|
33849
|
+
const privacyRef = useRef33(null);
|
|
33850
|
+
useEffect114(() => {
|
|
33525
33851
|
function handleClickOutside(event) {
|
|
33526
33852
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
33527
33853
|
setIsMenuOpen(false);
|
|
@@ -33543,7 +33869,7 @@ function PageHeader({
|
|
|
33543
33869
|
setIsMenuOpen(false);
|
|
33544
33870
|
}
|
|
33545
33871
|
};
|
|
33546
|
-
return /* @__PURE__ */
|
|
33872
|
+
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
33873
|
"button",
|
|
33548
33874
|
{
|
|
33549
33875
|
style: {
|
|
@@ -33555,9 +33881,9 @@ function PageHeader({
|
|
|
33555
33881
|
setIsPrivacyOpen(false);
|
|
33556
33882
|
}
|
|
33557
33883
|
},
|
|
33558
|
-
/* @__PURE__ */
|
|
33559
|
-
/* @__PURE__ */
|
|
33560
|
-
), /* @__PURE__ */
|
|
33884
|
+
/* @__PURE__ */ React302.createElement("span", { style: styles.menuItemIcon }, "\u{1F512}"),
|
|
33885
|
+
/* @__PURE__ */ React302.createElement("span", null, "Private")
|
|
33886
|
+
), /* @__PURE__ */ React302.createElement(
|
|
33561
33887
|
"button",
|
|
33562
33888
|
{
|
|
33563
33889
|
style: {
|
|
@@ -33569,9 +33895,9 @@ function PageHeader({
|
|
|
33569
33895
|
setIsPrivacyOpen(false);
|
|
33570
33896
|
}
|
|
33571
33897
|
},
|
|
33572
|
-
/* @__PURE__ */
|
|
33573
|
-
/* @__PURE__ */
|
|
33574
|
-
)))), /* @__PURE__ */
|
|
33898
|
+
/* @__PURE__ */ React302.createElement("span", { style: styles.menuItemIcon }, "\u{1F310}"),
|
|
33899
|
+
/* @__PURE__ */ React302.createElement("span", null, "Public")
|
|
33900
|
+
)))), /* @__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
33901
|
"button",
|
|
33576
33902
|
{
|
|
33577
33903
|
style: {
|
|
@@ -33581,8 +33907,8 @@ function PageHeader({
|
|
|
33581
33907
|
onClick: () => handleMenuItemClick(item),
|
|
33582
33908
|
disabled: item.disabled
|
|
33583
33909
|
},
|
|
33584
|
-
item.icon && /* @__PURE__ */
|
|
33585
|
-
/* @__PURE__ */
|
|
33910
|
+
item.icon && /* @__PURE__ */ React302.createElement("span", { style: styles.menuItemIcon }, item.icon),
|
|
33911
|
+
/* @__PURE__ */ React302.createElement("span", null, item.label)
|
|
33586
33912
|
)))))));
|
|
33587
33913
|
}
|
|
33588
33914
|
var styles = {
|
|
@@ -33719,15 +34045,15 @@ var styles = {
|
|
|
33719
34045
|
};
|
|
33720
34046
|
|
|
33721
34047
|
// src/mantine/components/EntitySigningSetup.tsx
|
|
33722
|
-
import
|
|
33723
|
-
import { Modal as Modal3, Stack as
|
|
34048
|
+
import React303, { useState as useState141 } from "react";
|
|
34049
|
+
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
34050
|
import { IconAlertCircle as IconAlertCircle20, IconCheck as IconCheck23, IconKey as IconKey2 } from "@tabler/icons-react";
|
|
33725
34051
|
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] =
|
|
34052
|
+
const [pin, setPin] = useState141("");
|
|
34053
|
+
const [confirmPin, setConfirmPin] = useState141("");
|
|
34054
|
+
const [loading, setLoading] = useState141(false);
|
|
34055
|
+
const [error, setError] = useState141(null);
|
|
34056
|
+
const [success, setSuccess] = useState141(false);
|
|
33731
34057
|
const handleSetup = async () => {
|
|
33732
34058
|
if (pin.length < 4) {
|
|
33733
34059
|
setError("PIN must be at least 4 characters");
|
|
@@ -33767,15 +34093,15 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
33767
34093
|
setSuccess(false);
|
|
33768
34094
|
}
|
|
33769
34095
|
};
|
|
33770
|
-
return /* @__PURE__ */
|
|
34096
|
+
return /* @__PURE__ */ React303.createElement(
|
|
33771
34097
|
Modal3,
|
|
33772
34098
|
{
|
|
33773
34099
|
opened,
|
|
33774
34100
|
onClose: handleClose,
|
|
33775
|
-
title: /* @__PURE__ */
|
|
34101
|
+
title: /* @__PURE__ */ React303.createElement(Group110, { gap: "xs" }, /* @__PURE__ */ React303.createElement(IconKey2, { size: 20 }), /* @__PURE__ */ React303.createElement(Text174, { fw: 600 }, "Entity Signing Setup")),
|
|
33776
34102
|
size: "md"
|
|
33777
34103
|
},
|
|
33778
|
-
/* @__PURE__ */
|
|
34104
|
+
/* @__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
34105
|
TextInput8,
|
|
33780
34106
|
{
|
|
33781
34107
|
label: "Enter PIN to encrypt signing key",
|
|
@@ -33786,25 +34112,25 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
33786
34112
|
onChange: (e) => setPin(e.currentTarget.value),
|
|
33787
34113
|
disabled: loading
|
|
33788
34114
|
}
|
|
33789
|
-
), /* @__PURE__ */
|
|
34115
|
+
), /* @__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
34116
|
);
|
|
33791
34117
|
};
|
|
33792
34118
|
|
|
33793
34119
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
33794
|
-
import
|
|
33795
|
-
import { Stack as
|
|
34120
|
+
import React304, { useState as useState142, useEffect as useEffect115, useMemo as useMemo124 } from "react";
|
|
34121
|
+
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
34122
|
import { IconPlus as IconPlus11, IconTrash as IconTrash12, IconShieldCheck as IconShieldCheck16, IconUser as IconUser14, IconRobot as IconRobot4, IconBuilding as IconBuilding2 } from "@tabler/icons-react";
|
|
33797
34123
|
var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission, onRevokePermission, getUserDisplayName }) => {
|
|
33798
|
-
const [delegations, setDelegations] =
|
|
33799
|
-
const [loading, setLoading] =
|
|
33800
|
-
const [revoking, setRevoking] =
|
|
33801
|
-
const rootDelegation =
|
|
34124
|
+
const [delegations, setDelegations] = useState142([]);
|
|
34125
|
+
const [loading, setLoading] = useState142(true);
|
|
34126
|
+
const [revoking, setRevoking] = useState142(null);
|
|
34127
|
+
const rootDelegation = useMemo124(() => {
|
|
33802
34128
|
if (editor.getUcanService) {
|
|
33803
34129
|
return editor.getUcanService()?.getRootDelegation() || null;
|
|
33804
34130
|
}
|
|
33805
34131
|
return null;
|
|
33806
34132
|
}, [editor]);
|
|
33807
|
-
|
|
34133
|
+
useEffect115(() => {
|
|
33808
34134
|
const loadDelegations = async () => {
|
|
33809
34135
|
setLoading(true);
|
|
33810
34136
|
let allDelegations = [];
|
|
@@ -33846,11 +34172,11 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
33846
34172
|
const getIcon2 = (type) => {
|
|
33847
34173
|
switch (type) {
|
|
33848
34174
|
case "oracle":
|
|
33849
|
-
return /* @__PURE__ */
|
|
34175
|
+
return /* @__PURE__ */ React304.createElement(IconRobot4, { size: 16 });
|
|
33850
34176
|
case "entity":
|
|
33851
|
-
return /* @__PURE__ */
|
|
34177
|
+
return /* @__PURE__ */ React304.createElement(IconBuilding2, { size: 16 });
|
|
33852
34178
|
default:
|
|
33853
|
-
return /* @__PURE__ */
|
|
34179
|
+
return /* @__PURE__ */ React304.createElement(IconUser14, { size: 16 });
|
|
33854
34180
|
}
|
|
33855
34181
|
};
|
|
33856
34182
|
const formatCapabilities = (caps) => {
|
|
@@ -33869,32 +34195,32 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
33869
34195
|
if (date < /* @__PURE__ */ new Date()) return "Expired";
|
|
33870
34196
|
return date.toLocaleDateString();
|
|
33871
34197
|
};
|
|
33872
|
-
return /* @__PURE__ */
|
|
34198
|
+
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
34199
|
};
|
|
33874
34200
|
|
|
33875
34201
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
33876
|
-
import
|
|
33877
|
-
import { Modal as Modal4, Stack as
|
|
34202
|
+
import React305, { useState as useState143, useCallback as useCallback113 } from "react";
|
|
34203
|
+
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
34204
|
import { IconSearch as IconSearch8, IconUser as IconUser15, IconRobot as IconRobot5, IconX as IconX14, IconShieldPlus as IconShieldPlus4 } from "@tabler/icons-react";
|
|
33879
34205
|
var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, searchUsers, getOracles, onGrant }) => {
|
|
33880
34206
|
const singleBlockMode = !!targetBlockId || blocks.length === 1;
|
|
33881
34207
|
const fixedBlockId = targetBlockId || (blocks.length === 1 ? blocks[0].id : null);
|
|
33882
34208
|
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 =
|
|
34209
|
+
const [recipientType, setRecipientType] = useState143("user");
|
|
34210
|
+
const [searchQuery, setSearchQuery] = useState143("");
|
|
34211
|
+
const [searchResults, setSearchResults] = useState143([]);
|
|
34212
|
+
const [searching, setSearching] = useState143(false);
|
|
34213
|
+
const [selectedRecipient, setSelectedRecipient] = useState143(null);
|
|
34214
|
+
const [manualDid, setManualDid] = useState143("");
|
|
34215
|
+
const [scopeType, setScopeType] = useState143("full");
|
|
34216
|
+
const [selectedBlocks, setSelectedBlocks] = useState143([]);
|
|
34217
|
+
const [expirationEnabled, setExpirationEnabled] = useState143(false);
|
|
34218
|
+
const [expirationDays, setExpirationDays] = useState143(30);
|
|
34219
|
+
const [canDelegate, setCanDelegate] = useState143(false);
|
|
34220
|
+
const [pin, setPin] = useState143("");
|
|
34221
|
+
const [loading, setLoading] = useState143(false);
|
|
34222
|
+
const [error, setError] = useState143(null);
|
|
34223
|
+
const handleSearch = useCallback113(async () => {
|
|
33898
34224
|
if (searchQuery.length < 2) return;
|
|
33899
34225
|
setSearching(true);
|
|
33900
34226
|
try {
|
|
@@ -33981,15 +34307,15 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
33981
34307
|
resetForm();
|
|
33982
34308
|
}
|
|
33983
34309
|
};
|
|
33984
|
-
return /* @__PURE__ */
|
|
34310
|
+
return /* @__PURE__ */ React305.createElement(
|
|
33985
34311
|
Modal4,
|
|
33986
34312
|
{
|
|
33987
34313
|
opened,
|
|
33988
34314
|
onClose: handleClose,
|
|
33989
|
-
title: /* @__PURE__ */
|
|
34315
|
+
title: /* @__PURE__ */ React305.createElement(Group112, { gap: "xs" }, /* @__PURE__ */ React305.createElement(IconShieldPlus4, { size: 20 }), /* @__PURE__ */ React305.createElement(Text176, { fw: 600 }, "Grant Permission")),
|
|
33990
34316
|
size: "lg"
|
|
33991
34317
|
},
|
|
33992
|
-
/* @__PURE__ */
|
|
34318
|
+
/* @__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
34319
|
Radio5.Group,
|
|
33994
34320
|
{
|
|
33995
34321
|
value: recipientType,
|
|
@@ -33999,23 +34325,23 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
33999
34325
|
setSearchResults([]);
|
|
34000
34326
|
}
|
|
34001
34327
|
},
|
|
34002
|
-
/* @__PURE__ */
|
|
34003
|
-
)), recipientType !== "manual" ? /* @__PURE__ */
|
|
34328
|
+
/* @__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" }))
|
|
34329
|
+
)), recipientType !== "manual" ? /* @__PURE__ */ React305.createElement(Stack201, { gap: "xs" }, /* @__PURE__ */ React305.createElement(
|
|
34004
34330
|
TextInput9,
|
|
34005
34331
|
{
|
|
34006
34332
|
placeholder: recipientType === "oracle" ? "Search oracles..." : "Search users...",
|
|
34007
|
-
leftSection: /* @__PURE__ */
|
|
34008
|
-
rightSection: searching ? /* @__PURE__ */
|
|
34333
|
+
leftSection: /* @__PURE__ */ React305.createElement(IconSearch8, { size: 16 }),
|
|
34334
|
+
rightSection: searching ? /* @__PURE__ */ React305.createElement(Loader55, { size: 14 }) : null,
|
|
34009
34335
|
value: searchQuery,
|
|
34010
34336
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
34011
34337
|
onKeyDown: (e) => e.key === "Enter" && handleSearch()
|
|
34012
34338
|
}
|
|
34013
|
-
), selectedRecipient ? /* @__PURE__ */
|
|
34339
|
+
), 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
34340
|
// Single block mode: show fixed block info
|
|
34015
|
-
/* @__PURE__ */
|
|
34341
|
+
/* @__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
34342
|
) : (
|
|
34017
34343
|
// Multi-block mode: show scope selection
|
|
34018
|
-
/* @__PURE__ */
|
|
34344
|
+
/* @__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
34345
|
Checkbox13,
|
|
34020
34346
|
{
|
|
34021
34347
|
key: block.id,
|
|
@@ -34030,7 +34356,7 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
34030
34356
|
}
|
|
34031
34357
|
}
|
|
34032
34358
|
)))))
|
|
34033
|
-
)), /* @__PURE__ */
|
|
34359
|
+
)), /* @__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
34360
|
Checkbox13,
|
|
34035
34361
|
{
|
|
34036
34362
|
label: "Recipient can grant permissions to others",
|
|
@@ -34038,7 +34364,7 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
34038
34364
|
checked: canDelegate,
|
|
34039
34365
|
onChange: (e) => setCanDelegate(e.currentTarget.checked)
|
|
34040
34366
|
}
|
|
34041
|
-
), /* @__PURE__ */
|
|
34367
|
+
), /* @__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
34368
|
);
|
|
34043
34369
|
};
|
|
34044
34370
|
|
|
@@ -34152,4 +34478,4 @@ export {
|
|
|
34152
34478
|
getExtraSlashMenuItems,
|
|
34153
34479
|
useCreateIxoEditor
|
|
34154
34480
|
};
|
|
34155
|
-
//# sourceMappingURL=chunk-
|
|
34481
|
+
//# sourceMappingURL=chunk-CITHJ6JU.mjs.map
|