@ixo/editor 3.0.0-beta.23 → 3.0.0-beta.25
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/{capabilityValidation-B3NRVwYZ.d.ts → capabilityValidation-BSzFr-F6.d.ts} +1 -1
- package/dist/{chunk-GKAKYGC3.mjs → chunk-TLYT3OAQ.mjs} +538 -250
- package/dist/chunk-TLYT3OAQ.mjs.map +1 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/{graphql-client-OErTZSm9.d.ts → graphql-client-CJ0vMGiH.d.ts} +1 -1
- package/dist/{index-CnqA4qDa.d.ts → index-aAHFla8N.d.ts} +56 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/mantine/index.d.ts +4 -4
- package/dist/mantine/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-GKAKYGC3.mjs.map +0 -1
|
@@ -929,7 +929,8 @@ var CONDITIONABLE_PROPERTIES = {
|
|
|
929
929
|
description: "Number of configured links"
|
|
930
930
|
}
|
|
931
931
|
],
|
|
932
|
-
action: []
|
|
932
|
+
action: [],
|
|
933
|
+
embed: []
|
|
933
934
|
};
|
|
934
935
|
function getConditionableProperties(blockType, block) {
|
|
935
936
|
const baseProperties = CONDITIONABLE_PROPERTIES[blockType] || [];
|
|
@@ -3216,7 +3217,8 @@ import {
|
|
|
3216
3217
|
IconDotsCircleHorizontal,
|
|
3217
3218
|
IconUsers as IconUsers3,
|
|
3218
3219
|
IconExternalLink,
|
|
3219
|
-
IconBolt
|
|
3220
|
+
IconBolt,
|
|
3221
|
+
IconCode
|
|
3220
3222
|
} from "@tabler/icons-react";
|
|
3221
3223
|
var ICON_MAP = {
|
|
3222
3224
|
"square-check": IconSquareCheck,
|
|
@@ -3233,7 +3235,8 @@ var ICON_MAP = {
|
|
|
3233
3235
|
"dots-circle": IconDotsCircleHorizontal,
|
|
3234
3236
|
users: IconUsers3,
|
|
3235
3237
|
"external-link": IconExternalLink,
|
|
3236
|
-
bolt: IconBolt
|
|
3238
|
+
bolt: IconBolt,
|
|
3239
|
+
code: IconCode
|
|
3237
3240
|
};
|
|
3238
3241
|
var getIcon = (fallback = "square-check", key, color = "white", size = 26, stroke = 1.5) => {
|
|
3239
3242
|
const validKey = key in ICON_MAP ? key : fallback;
|
|
@@ -14287,7 +14290,7 @@ import React149, { useMemo as useMemo48 } from "react";
|
|
|
14287
14290
|
|
|
14288
14291
|
// src/mantine/blocks/apiRequest/template/TemplateConfig.tsx
|
|
14289
14292
|
import React148, { useCallback as useCallback39, useMemo as useMemo47 } from "react";
|
|
14290
|
-
import { IconSettings as IconSettings7, IconCode, IconShieldCheck as IconShieldCheck7, IconUser as IconUser7, IconChecklist as IconChecklist5, IconClock as IconClock6 } from "@tabler/icons-react";
|
|
14293
|
+
import { IconSettings as IconSettings7, IconCode as IconCode2, IconShieldCheck as IconShieldCheck7, IconUser as IconUser7, IconChecklist as IconChecklist5, IconClock as IconClock6 } from "@tabler/icons-react";
|
|
14291
14294
|
|
|
14292
14295
|
// src/mantine/blocks/apiRequest/template/GeneralTab.tsx
|
|
14293
14296
|
import React145, { useEffect as useEffect46, useState as useState57 } from "react";
|
|
@@ -15055,7 +15058,7 @@ var TemplateConfig5 = ({ editor, block }) => {
|
|
|
15055
15058
|
{
|
|
15056
15059
|
label: "Response Schema",
|
|
15057
15060
|
value: "response-schema",
|
|
15058
|
-
icon: icon(
|
|
15061
|
+
icon: icon(IconCode2),
|
|
15059
15062
|
content: /* @__PURE__ */ React148.createElement(ResponseSchemaTab, { schema: parsedResponseSchema, onSchemaChange: handleSchemaChange, blockId: block.id })
|
|
15060
15063
|
},
|
|
15061
15064
|
{
|
|
@@ -29617,6 +29620,249 @@ var LocationBlockSpec = createReactBlockSpec21(
|
|
|
29617
29620
|
}
|
|
29618
29621
|
);
|
|
29619
29622
|
|
|
29623
|
+
// src/mantine/blocks/embed/EmbedBlockSpec.tsx
|
|
29624
|
+
import React285 from "react";
|
|
29625
|
+
import { createReactBlockSpec as createReactBlockSpec22 } from "@blocknote/react";
|
|
29626
|
+
|
|
29627
|
+
// src/mantine/blocks/embed/EmbedBlock.tsx
|
|
29628
|
+
import React284 from "react";
|
|
29629
|
+
|
|
29630
|
+
// src/mantine/blocks/embed/template/TemplateView.tsx
|
|
29631
|
+
import React281, { useMemo as useMemo110 } from "react";
|
|
29632
|
+
import { Box as Box54, Group as Group103, Stack as Stack192, Text as Text163 } from "@mantine/core";
|
|
29633
|
+
|
|
29634
|
+
// src/mantine/blocks/embed/template/TemplateConfig.tsx
|
|
29635
|
+
import React280, { useCallback as useCallback101 } from "react";
|
|
29636
|
+
import { IconSettings as IconSettings20 } from "@tabler/icons-react";
|
|
29637
|
+
|
|
29638
|
+
// src/mantine/blocks/embed/template/GeneralTab.tsx
|
|
29639
|
+
import React279, { useEffect as useEffect101, useState as useState124 } from "react";
|
|
29640
|
+
import { Stack as Stack191, Switch as Switch7, Text as Text162 } from "@mantine/core";
|
|
29641
|
+
var GeneralTab18 = ({
|
|
29642
|
+
url,
|
|
29643
|
+
title,
|
|
29644
|
+
description,
|
|
29645
|
+
icon: icon2,
|
|
29646
|
+
height,
|
|
29647
|
+
allowAuth,
|
|
29648
|
+
onUrlChange,
|
|
29649
|
+
onTitleChange,
|
|
29650
|
+
onDescriptionChange,
|
|
29651
|
+
onIconChange,
|
|
29652
|
+
onHeightChange,
|
|
29653
|
+
onAllowAuthChange
|
|
29654
|
+
}) => {
|
|
29655
|
+
const [localUrl, setLocalUrl] = useState124(url);
|
|
29656
|
+
const [localHeight, setLocalHeight] = useState124(height);
|
|
29657
|
+
const iconOptions = Object.keys(ICON_MAP).map((key) => ({
|
|
29658
|
+
value: key,
|
|
29659
|
+
label: key.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ")
|
|
29660
|
+
}));
|
|
29661
|
+
useEffect101(() => {
|
|
29662
|
+
setLocalUrl(url);
|
|
29663
|
+
}, [url]);
|
|
29664
|
+
useEffect101(() => {
|
|
29665
|
+
setLocalHeight(height);
|
|
29666
|
+
}, [height]);
|
|
29667
|
+
return /* @__PURE__ */ React279.createElement(Stack191, { gap: "md" }, /* @__PURE__ */ React279.createElement(Stack191, { gap: "xs" }, /* @__PURE__ */ React279.createElement(Text162, { size: "sm", fw: 600 }, "URL"), /* @__PURE__ */ React279.createElement(
|
|
29668
|
+
BaseTextInput,
|
|
29669
|
+
{
|
|
29670
|
+
placeholder: "https://example.com",
|
|
29671
|
+
value: localUrl,
|
|
29672
|
+
onChange: (event) => {
|
|
29673
|
+
const v = event.currentTarget.value;
|
|
29674
|
+
setLocalUrl(v);
|
|
29675
|
+
onUrlChange(v);
|
|
29676
|
+
}
|
|
29677
|
+
}
|
|
29678
|
+
), /* @__PURE__ */ React279.createElement(Text162, { size: "xs", c: "dimmed" }, "Enter the URL of the page to embed.")), /* @__PURE__ */ React279.createElement(BaseTextInput, { label: "Title", placeholder: "e.g. Dashboard", value: title, onChange: (e) => onTitleChange(e.currentTarget.value) }), /* @__PURE__ */ React279.createElement(BaseTextArea, { label: "Description", placeholder: "Enter description", value: description, onChange: (e) => onDescriptionChange(e.currentTarget.value), minRows: 2 }), /* @__PURE__ */ React279.createElement(BaseSelect, { label: "Icon", placeholder: "Select an icon", value: icon2 || "code", onChange: (value) => onIconChange(value || "code"), data: iconOptions, searchable: true }), /* @__PURE__ */ React279.createElement(
|
|
29679
|
+
BaseTextInput,
|
|
29680
|
+
{
|
|
29681
|
+
label: "Height (px)",
|
|
29682
|
+
type: "number",
|
|
29683
|
+
placeholder: "400",
|
|
29684
|
+
value: localHeight,
|
|
29685
|
+
onChange: (event) => {
|
|
29686
|
+
const v = event.currentTarget.value;
|
|
29687
|
+
setLocalHeight(v);
|
|
29688
|
+
onHeightChange(v);
|
|
29689
|
+
}
|
|
29690
|
+
}
|
|
29691
|
+
), /* @__PURE__ */ React279.createElement(Stack191, { gap: "xs" }, /* @__PURE__ */ React279.createElement(Switch7, { label: "Allow authenticated embeds", checked: allowAuth, onChange: (event) => onAllowAuthChange(event.currentTarget.checked) }), /* @__PURE__ */ React279.createElement(Text162, { size: "xs", c: "dimmed" }, "Enable for services like Google Calendar that require cookie access. Only use with trusted URLs.")));
|
|
29692
|
+
};
|
|
29693
|
+
|
|
29694
|
+
// src/mantine/blocks/embed/template/TemplateConfig.tsx
|
|
29695
|
+
var TemplateConfig18 = ({ editor, block }) => {
|
|
29696
|
+
const { closePanel } = usePanelStore();
|
|
29697
|
+
const updateProp = useCallback101(
|
|
29698
|
+
(key, value) => {
|
|
29699
|
+
editor.updateBlock(block, { props: { ...block.props, [key]: value } });
|
|
29700
|
+
},
|
|
29701
|
+
[editor, block]
|
|
29702
|
+
);
|
|
29703
|
+
const tabs = [
|
|
29704
|
+
{
|
|
29705
|
+
label: "General",
|
|
29706
|
+
value: "general",
|
|
29707
|
+
icon: icon(IconSettings20),
|
|
29708
|
+
content: /* @__PURE__ */ React280.createElement(
|
|
29709
|
+
GeneralTab18,
|
|
29710
|
+
{
|
|
29711
|
+
url: block.props.url || "",
|
|
29712
|
+
title: block.props.title || "",
|
|
29713
|
+
description: block.props.description || "",
|
|
29714
|
+
icon: block.props.icon || "code",
|
|
29715
|
+
height: block.props.height || "400",
|
|
29716
|
+
allowAuth: block.props.allowAuth === "true",
|
|
29717
|
+
onUrlChange: (v) => updateProp("url", v),
|
|
29718
|
+
onTitleChange: (v) => updateProp("title", v),
|
|
29719
|
+
onDescriptionChange: (v) => updateProp("description", v),
|
|
29720
|
+
onIconChange: (v) => updateProp("icon", v),
|
|
29721
|
+
onHeightChange: (v) => updateProp("height", v),
|
|
29722
|
+
onAllowAuthChange: (v) => updateProp("allowAuth", String(v))
|
|
29723
|
+
}
|
|
29724
|
+
)
|
|
29725
|
+
}
|
|
29726
|
+
];
|
|
29727
|
+
return /* @__PURE__ */ React280.createElement(BaseRightPanelLayout, { title: "Embed Settings", onClose: closePanel, tabs, context: { editor, block } });
|
|
29728
|
+
};
|
|
29729
|
+
|
|
29730
|
+
// src/mantine/blocks/embed/sanitizeUrl.ts
|
|
29731
|
+
var ALLOWED_PROTOCOLS = ["https:"];
|
|
29732
|
+
function sanitizeEmbedUrl(raw) {
|
|
29733
|
+
if (!raw) return null;
|
|
29734
|
+
try {
|
|
29735
|
+
const url = new URL(raw);
|
|
29736
|
+
if (ALLOWED_PROTOCOLS.includes(url.protocol)) {
|
|
29737
|
+
return url.href;
|
|
29738
|
+
}
|
|
29739
|
+
} catch {
|
|
29740
|
+
}
|
|
29741
|
+
return null;
|
|
29742
|
+
}
|
|
29743
|
+
|
|
29744
|
+
// src/mantine/blocks/embed/template/TemplateView.tsx
|
|
29745
|
+
var EMBED_TEMPLATE_PANEL_ID = "embed-template-panel";
|
|
29746
|
+
var EmbedTemplateView = ({ editor, block }) => {
|
|
29747
|
+
const panelId = `${EMBED_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
29748
|
+
const panelContent = useMemo110(() => /* @__PURE__ */ React281.createElement(TemplateConfig18, { editor, block }), [editor, block]);
|
|
29749
|
+
const { open } = usePanel(panelId, panelContent);
|
|
29750
|
+
const safeUrl = sanitizeEmbedUrl(block.props.url);
|
|
29751
|
+
const height = Number(block.props.height) || 400;
|
|
29752
|
+
const sandbox = block.props.allowAuth === "true" ? "allow-scripts allow-same-origin allow-forms allow-popups" : "allow-scripts allow-forms allow-popups";
|
|
29753
|
+
return /* @__PURE__ */ React281.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React281.createElement(Stack192, { gap: "xs", justify: "center" }, /* @__PURE__ */ React281.createElement(Group103, { wrap: "nowrap", align: "center" }, getIcon("code", block.props.icon), /* @__PURE__ */ React281.createElement(Stack192, { gap: 2 }, /* @__PURE__ */ React281.createElement(Text163, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Embed"), /* @__PURE__ */ React281.createElement(Text163, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, block.props.description || safeUrl || "Click to configure"))), safeUrl && /* @__PURE__ */ React281.createElement(Box54, { style: { borderRadius: 8, overflow: "hidden" } }, /* @__PURE__ */ React281.createElement(
|
|
29754
|
+
"iframe",
|
|
29755
|
+
{
|
|
29756
|
+
src: safeUrl,
|
|
29757
|
+
title: block.props.title || "Embedded content",
|
|
29758
|
+
width: "100%",
|
|
29759
|
+
height,
|
|
29760
|
+
style: { border: "none", display: "block" },
|
|
29761
|
+
sandbox,
|
|
29762
|
+
referrerPolicy: "strict-origin-when-cross-origin",
|
|
29763
|
+
loading: "lazy"
|
|
29764
|
+
}
|
|
29765
|
+
))));
|
|
29766
|
+
};
|
|
29767
|
+
|
|
29768
|
+
// src/mantine/blocks/embed/flow/FlowView.tsx
|
|
29769
|
+
import React283, { useMemo as useMemo111 } from "react";
|
|
29770
|
+
import { Box as Box55, Group as Group104, Stack as Stack193, Text as Text164 } from "@mantine/core";
|
|
29771
|
+
|
|
29772
|
+
// src/mantine/blocks/embed/flow/FlowConfig.tsx
|
|
29773
|
+
import React282, { useCallback as useCallback102 } from "react";
|
|
29774
|
+
import { IconSettings as IconSettings21 } from "@tabler/icons-react";
|
|
29775
|
+
var FlowConfig4 = ({ editor, block }) => {
|
|
29776
|
+
const { closePanel } = usePanelStore();
|
|
29777
|
+
const updateProp = useCallback102(
|
|
29778
|
+
(key, value) => {
|
|
29779
|
+
editor.updateBlock(block, { props: { ...block.props, [key]: value } });
|
|
29780
|
+
},
|
|
29781
|
+
[editor, block]
|
|
29782
|
+
);
|
|
29783
|
+
const tabs = [
|
|
29784
|
+
{
|
|
29785
|
+
label: "General",
|
|
29786
|
+
value: "general",
|
|
29787
|
+
icon: icon(IconSettings21),
|
|
29788
|
+
content: /* @__PURE__ */ React282.createElement(
|
|
29789
|
+
GeneralTab18,
|
|
29790
|
+
{
|
|
29791
|
+
url: block.props.url || "",
|
|
29792
|
+
title: block.props.title || "",
|
|
29793
|
+
description: block.props.description || "",
|
|
29794
|
+
icon: block.props.icon || "code",
|
|
29795
|
+
height: block.props.height || "400",
|
|
29796
|
+
allowAuth: block.props.allowAuth === "true",
|
|
29797
|
+
onUrlChange: (v) => updateProp("url", v),
|
|
29798
|
+
onTitleChange: (v) => updateProp("title", v),
|
|
29799
|
+
onDescriptionChange: (v) => updateProp("description", v),
|
|
29800
|
+
onIconChange: (v) => updateProp("icon", v),
|
|
29801
|
+
onHeightChange: (v) => updateProp("height", v),
|
|
29802
|
+
onAllowAuthChange: (v) => updateProp("allowAuth", String(v))
|
|
29803
|
+
}
|
|
29804
|
+
)
|
|
29805
|
+
}
|
|
29806
|
+
];
|
|
29807
|
+
return /* @__PURE__ */ React282.createElement(BaseRightPanelLayout, { title: "Embed Settings", onClose: closePanel, tabs, context: { editor, block }, isTemplate: false });
|
|
29808
|
+
};
|
|
29809
|
+
|
|
29810
|
+
// src/mantine/blocks/embed/flow/FlowView.tsx
|
|
29811
|
+
var EMBED_FLOW_PANEL_ID = "embed-flow-panel";
|
|
29812
|
+
var EmbedFlowView = ({ editor, block }) => {
|
|
29813
|
+
const panelId = `${EMBED_FLOW_PANEL_ID}-${block.id}`;
|
|
29814
|
+
const panelContent = useMemo111(() => /* @__PURE__ */ React283.createElement(FlowConfig4, { editor, block }), [editor, block]);
|
|
29815
|
+
const { open } = usePanel(panelId, panelContent);
|
|
29816
|
+
const safeUrl = sanitizeEmbedUrl(block.props.url);
|
|
29817
|
+
const height = Number(block.props.height) || 400;
|
|
29818
|
+
const sandbox = block.props.allowAuth === "true" ? "allow-scripts allow-same-origin allow-forms allow-popups" : "allow-scripts allow-forms allow-popups";
|
|
29819
|
+
return /* @__PURE__ */ React283.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React283.createElement(Stack193, { gap: "xs", justify: "center" }, /* @__PURE__ */ React283.createElement(Group104, { wrap: "nowrap", align: "center" }, getIcon("code", block.props.icon), /* @__PURE__ */ React283.createElement(Stack193, { gap: 2 }, /* @__PURE__ */ React283.createElement(Text164, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Embed"), /* @__PURE__ */ React283.createElement(Text164, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, block.props.description || safeUrl || "No URL configured"))), safeUrl && /* @__PURE__ */ React283.createElement(Box55, { style: { borderRadius: 8, overflow: "hidden" } }, /* @__PURE__ */ React283.createElement(
|
|
29820
|
+
"iframe",
|
|
29821
|
+
{
|
|
29822
|
+
src: safeUrl,
|
|
29823
|
+
title: block.props.title || "Embedded content",
|
|
29824
|
+
width: "100%",
|
|
29825
|
+
height,
|
|
29826
|
+
style: { border: "none", display: "block" },
|
|
29827
|
+
sandbox,
|
|
29828
|
+
referrerPolicy: "strict-origin-when-cross-origin",
|
|
29829
|
+
loading: "lazy"
|
|
29830
|
+
}
|
|
29831
|
+
))));
|
|
29832
|
+
};
|
|
29833
|
+
|
|
29834
|
+
// src/mantine/blocks/embed/EmbedBlock.tsx
|
|
29835
|
+
function EmbedBlock({ editor, block }) {
|
|
29836
|
+
const { docType } = useBlocknoteContext();
|
|
29837
|
+
if (docType === "template" || docType === "page") {
|
|
29838
|
+
return /* @__PURE__ */ React284.createElement(EmbedTemplateView, { editor, block });
|
|
29839
|
+
}
|
|
29840
|
+
return /* @__PURE__ */ React284.createElement(EmbedFlowView, { editor, block });
|
|
29841
|
+
}
|
|
29842
|
+
|
|
29843
|
+
// src/mantine/blocks/embed/EmbedBlockSpec.tsx
|
|
29844
|
+
var EmbedBlockSpec = createReactBlockSpec22(
|
|
29845
|
+
{
|
|
29846
|
+
type: "embed",
|
|
29847
|
+
propSchema: {
|
|
29848
|
+
url: { default: "" },
|
|
29849
|
+
title: { default: "" },
|
|
29850
|
+
description: { default: "" },
|
|
29851
|
+
icon: { default: "code" },
|
|
29852
|
+
height: { default: "400" },
|
|
29853
|
+
allowAuth: { default: "false" },
|
|
29854
|
+
skill: { default: "" }
|
|
29855
|
+
},
|
|
29856
|
+
content: "none"
|
|
29857
|
+
},
|
|
29858
|
+
{
|
|
29859
|
+
render: (props) => {
|
|
29860
|
+
const ixoProps = props;
|
|
29861
|
+
return /* @__PURE__ */ React285.createElement(EmbedBlock, { ...ixoProps });
|
|
29862
|
+
}
|
|
29863
|
+
}
|
|
29864
|
+
);
|
|
29865
|
+
|
|
29620
29866
|
// src/mantine/blocks/registry/blockRegistry.ts
|
|
29621
29867
|
var BlockRegistry = class {
|
|
29622
29868
|
constructor() {
|
|
@@ -29813,12 +30059,29 @@ blockRegistry.register({
|
|
|
29813
30059
|
validDependencies: [],
|
|
29814
30060
|
defaultProps: {}
|
|
29815
30061
|
});
|
|
30062
|
+
blockRegistry.register({
|
|
30063
|
+
type: "embed",
|
|
30064
|
+
propSchema: {
|
|
30065
|
+
url: "",
|
|
30066
|
+
title: "",
|
|
30067
|
+
description: "",
|
|
30068
|
+
icon: "code",
|
|
30069
|
+
height: "400",
|
|
30070
|
+
allowAuth: "false",
|
|
30071
|
+
skill: ""
|
|
30072
|
+
},
|
|
30073
|
+
validDependencies: [],
|
|
30074
|
+
defaultProps: {
|
|
30075
|
+
icon: "code",
|
|
30076
|
+
height: "400"
|
|
30077
|
+
}
|
|
30078
|
+
});
|
|
29816
30079
|
|
|
29817
30080
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
29818
|
-
import { useMemo as
|
|
30081
|
+
import { useMemo as useMemo112, useEffect as useEffect102, useState as useState125, useCallback as useCallback103 } from "react";
|
|
29819
30082
|
|
|
29820
30083
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
29821
|
-
import { useMemo as
|
|
30084
|
+
import { useMemo as useMemo113 } from "react";
|
|
29822
30085
|
|
|
29823
30086
|
// src/mantine/blocks/index.ts
|
|
29824
30087
|
var blockSpecs = {
|
|
@@ -29842,7 +30105,8 @@ var blockSpecs = {
|
|
|
29842
30105
|
governanceGroup: GovernanceGroupBlockSpec,
|
|
29843
30106
|
flowLink: FlowLinkBlockSpec,
|
|
29844
30107
|
action: ActionBlockSpec,
|
|
29845
|
-
location: LocationBlockSpec
|
|
30108
|
+
location: LocationBlockSpec,
|
|
30109
|
+
embed: EmbedBlockSpec
|
|
29846
30110
|
};
|
|
29847
30111
|
var getExtraSlashMenuItems = (editor) => {
|
|
29848
30112
|
const slashMenuList = [
|
|
@@ -30209,6 +30473,30 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30209
30473
|
aliases: ["location", "map", "gps", "coordinates"],
|
|
30210
30474
|
group: "Basics",
|
|
30211
30475
|
subtext: "Set a location on a map"
|
|
30476
|
+
},
|
|
30477
|
+
{
|
|
30478
|
+
title: "Embed",
|
|
30479
|
+
onItemClick: () => {
|
|
30480
|
+
editor.insertBlocks(
|
|
30481
|
+
[
|
|
30482
|
+
{
|
|
30483
|
+
type: "embed",
|
|
30484
|
+
props: {
|
|
30485
|
+
url: "",
|
|
30486
|
+
title: "",
|
|
30487
|
+
description: "",
|
|
30488
|
+
icon: "code",
|
|
30489
|
+
height: "400"
|
|
30490
|
+
}
|
|
30491
|
+
}
|
|
30492
|
+
],
|
|
30493
|
+
editor.getTextCursorPosition().block,
|
|
30494
|
+
"after"
|
|
30495
|
+
);
|
|
30496
|
+
},
|
|
30497
|
+
aliases: ["embed", "iframe", "website", "external"],
|
|
30498
|
+
group: "Basics",
|
|
30499
|
+
subtext: "Embed an external website or content via iframe"
|
|
30212
30500
|
}
|
|
30213
30501
|
];
|
|
30214
30502
|
const yRoot = editor?._yRoot;
|
|
@@ -30288,15 +30576,15 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
30288
30576
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
30289
30577
|
|
|
30290
30578
|
// src/core/hooks/useMatrixProvider.ts
|
|
30291
|
-
import { useEffect as
|
|
30579
|
+
import { useEffect as useEffect103, useState as useState126, useRef as useRef25, useCallback as useCallback104, useMemo as useMemo114 } from "react";
|
|
30292
30580
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
30293
30581
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
30294
|
-
const [matrixProvider, setProvider] =
|
|
30295
|
-
const [status, setStatus] =
|
|
30582
|
+
const [matrixProvider, setProvider] = useState126(null);
|
|
30583
|
+
const [status, setStatus] = useState126("disconnected");
|
|
30296
30584
|
const isMountedRef = useRef25(true);
|
|
30297
30585
|
const providerRef = useRef25(null);
|
|
30298
30586
|
const retryTimeoutRef = useRef25(null);
|
|
30299
|
-
const providerOptions =
|
|
30587
|
+
const providerOptions = useMemo114(
|
|
30300
30588
|
() => ({
|
|
30301
30589
|
translator: {
|
|
30302
30590
|
updateEventType: "matrix-crdt.doc_update",
|
|
@@ -30309,22 +30597,22 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
30309
30597
|
}),
|
|
30310
30598
|
[]
|
|
30311
30599
|
);
|
|
30312
|
-
const handleDocumentAvailable =
|
|
30600
|
+
const handleDocumentAvailable = useCallback104(() => {
|
|
30313
30601
|
if (isMountedRef.current) {
|
|
30314
30602
|
setStatus("connected");
|
|
30315
30603
|
}
|
|
30316
30604
|
}, []);
|
|
30317
|
-
const handleDocumentUnavailable =
|
|
30605
|
+
const handleDocumentUnavailable = useCallback104(() => {
|
|
30318
30606
|
if (isMountedRef.current) {
|
|
30319
30607
|
setStatus("failed");
|
|
30320
30608
|
}
|
|
30321
30609
|
}, []);
|
|
30322
|
-
const handleCanWriteChanged =
|
|
30610
|
+
const handleCanWriteChanged = useCallback104(() => {
|
|
30323
30611
|
if (isMountedRef.current && providerRef.current) {
|
|
30324
30612
|
setStatus(providerRef.current.canWrite ? "connected" : "failed");
|
|
30325
30613
|
}
|
|
30326
30614
|
}, []);
|
|
30327
|
-
const initProvider =
|
|
30615
|
+
const initProvider = useCallback104(async () => {
|
|
30328
30616
|
if (!isMountedRef.current) return;
|
|
30329
30617
|
if (retryTimeoutRef.current) {
|
|
30330
30618
|
clearTimeout(retryTimeoutRef.current);
|
|
@@ -30357,7 +30645,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
30357
30645
|
}
|
|
30358
30646
|
}
|
|
30359
30647
|
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
30360
|
-
|
|
30648
|
+
useEffect103(() => {
|
|
30361
30649
|
isMountedRef.current = true;
|
|
30362
30650
|
initProvider();
|
|
30363
30651
|
return () => {
|
|
@@ -30374,7 +30662,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
30374
30662
|
setStatus("disconnected");
|
|
30375
30663
|
};
|
|
30376
30664
|
}, [initProvider]);
|
|
30377
|
-
|
|
30665
|
+
useEffect103(() => {
|
|
30378
30666
|
return () => {
|
|
30379
30667
|
isMountedRef.current = false;
|
|
30380
30668
|
};
|
|
@@ -30383,17 +30671,17 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
30383
30671
|
}
|
|
30384
30672
|
|
|
30385
30673
|
// src/mantine/hooks/useCollaborativeYDoc.ts
|
|
30386
|
-
import { useMemo as
|
|
30674
|
+
import { useMemo as useMemo115 } from "react";
|
|
30387
30675
|
import * as Y from "yjs";
|
|
30388
30676
|
function useCollaborativeYDoc(_options) {
|
|
30389
|
-
return
|
|
30677
|
+
return useMemo115(() => {
|
|
30390
30678
|
const doc = new Y.Doc();
|
|
30391
30679
|
return doc;
|
|
30392
30680
|
}, []);
|
|
30393
30681
|
}
|
|
30394
30682
|
|
|
30395
30683
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
30396
|
-
import { useMemo as
|
|
30684
|
+
import { useMemo as useMemo116, useEffect as useEffect104, useState as useState127, useRef as useRef26 } from "react";
|
|
30397
30685
|
|
|
30398
30686
|
// src/core/lib/matrixMetadata.ts
|
|
30399
30687
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -30590,7 +30878,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
30590
30878
|
matrixClient,
|
|
30591
30879
|
permissions = { write: false }
|
|
30592
30880
|
} = options || {};
|
|
30593
|
-
const memoizedUser =
|
|
30881
|
+
const memoizedUser = useMemo116(
|
|
30594
30882
|
() => ({
|
|
30595
30883
|
id: user?.id || "",
|
|
30596
30884
|
name: user?.name || "",
|
|
@@ -30606,13 +30894,13 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
30606
30894
|
matrixClient,
|
|
30607
30895
|
roomId: options.roomId
|
|
30608
30896
|
});
|
|
30609
|
-
const metadataManager =
|
|
30610
|
-
|
|
30897
|
+
const metadataManager = useMemo116(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
30898
|
+
useEffect104(() => {
|
|
30611
30899
|
return () => {
|
|
30612
30900
|
metadataManager.dispose();
|
|
30613
30901
|
};
|
|
30614
30902
|
}, [metadataManager]);
|
|
30615
|
-
const defaultUploadFile =
|
|
30903
|
+
const defaultUploadFile = useMemo116(
|
|
30616
30904
|
() => uploadFile || (async (file) => {
|
|
30617
30905
|
return new Promise((resolve, reject) => {
|
|
30618
30906
|
const reader = new FileReader();
|
|
@@ -30626,7 +30914,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
30626
30914
|
}),
|
|
30627
30915
|
[uploadFile]
|
|
30628
30916
|
);
|
|
30629
|
-
const schema =
|
|
30917
|
+
const schema = useMemo116(
|
|
30630
30918
|
() => BlockNoteSchema2.create({
|
|
30631
30919
|
blockSpecs: {
|
|
30632
30920
|
...defaultBlockSpecs2,
|
|
@@ -30641,16 +30929,16 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
30641
30929
|
}),
|
|
30642
30930
|
[]
|
|
30643
30931
|
);
|
|
30644
|
-
const root =
|
|
30645
|
-
const documentFragment =
|
|
30646
|
-
const flowArray =
|
|
30647
|
-
const runtimeMap =
|
|
30648
|
-
const delegationsMap =
|
|
30649
|
-
const invocationsMap =
|
|
30650
|
-
const ucanDelegationStore =
|
|
30651
|
-
const invocationStore =
|
|
30652
|
-
const userFragment =
|
|
30653
|
-
const collaborationConfig =
|
|
30932
|
+
const root = useMemo116(() => yDoc.getMap("root"), [yDoc]);
|
|
30933
|
+
const documentFragment = useMemo116(() => yDoc.getXmlFragment("document"), [yDoc]);
|
|
30934
|
+
const flowArray = useMemo116(() => yDoc.getArray("flow"), [yDoc]);
|
|
30935
|
+
const runtimeMap = useMemo116(() => yDoc.getMap("runtime"), [yDoc]);
|
|
30936
|
+
const delegationsMap = useMemo116(() => yDoc.getMap("delegations"), [yDoc]);
|
|
30937
|
+
const invocationsMap = useMemo116(() => yDoc.getMap("invocations"), [yDoc]);
|
|
30938
|
+
const ucanDelegationStore = useMemo116(() => createUcanDelegationStore(delegationsMap), [delegationsMap]);
|
|
30939
|
+
const invocationStore = useMemo116(() => createInvocationStore(invocationsMap), [invocationsMap]);
|
|
30940
|
+
const userFragment = useMemo116(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
30941
|
+
const collaborationConfig = useMemo116(
|
|
30654
30942
|
() => ({
|
|
30655
30943
|
provider: matrixProvider,
|
|
30656
30944
|
fragment: documentFragment,
|
|
@@ -30662,7 +30950,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
30662
30950
|
}),
|
|
30663
30951
|
[matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
|
|
30664
30952
|
);
|
|
30665
|
-
const ixoConfig =
|
|
30953
|
+
const ixoConfig = useMemo116(
|
|
30666
30954
|
() => ({
|
|
30667
30955
|
theme,
|
|
30668
30956
|
editable,
|
|
@@ -30682,7 +30970,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
30682
30970
|
collaboration: collaborationConfig,
|
|
30683
30971
|
pasteHandler: ixoPasteHandler
|
|
30684
30972
|
});
|
|
30685
|
-
const titleText =
|
|
30973
|
+
const titleText = useMemo116(() => yDoc.getText("title"), [yDoc]);
|
|
30686
30974
|
let ixoEditor;
|
|
30687
30975
|
if (editor) {
|
|
30688
30976
|
ixoEditor = editor;
|
|
@@ -30874,12 +31162,12 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
30874
31162
|
return void 0;
|
|
30875
31163
|
};
|
|
30876
31164
|
}
|
|
30877
|
-
|
|
31165
|
+
useEffect104(() => {
|
|
30878
31166
|
if (ixoEditor) {
|
|
30879
31167
|
ixoEditor.isEditable = editable;
|
|
30880
31168
|
}
|
|
30881
31169
|
}, [ixoEditor, editable]);
|
|
30882
|
-
|
|
31170
|
+
useEffect104(() => {
|
|
30883
31171
|
if (connectionStatus !== "connected") {
|
|
30884
31172
|
return;
|
|
30885
31173
|
}
|
|
@@ -30901,10 +31189,10 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
30901
31189
|
titleText.insert(0, options.title);
|
|
30902
31190
|
}
|
|
30903
31191
|
}, [connectionStatus, root, titleText, permissions.write, options.docId, options.title, memoizedUser.id]);
|
|
30904
|
-
const [connectedUsers, setConnectedUsers] =
|
|
31192
|
+
const [connectedUsers, setConnectedUsers] = useState127([]);
|
|
30905
31193
|
const activeBlockIdRef = useRef26(null);
|
|
30906
31194
|
const awarenessInstance = matrixProvider?.awarenessInstance ?? null;
|
|
30907
|
-
|
|
31195
|
+
useEffect104(() => {
|
|
30908
31196
|
if (!awarenessInstance || connectionStatus !== "connected") {
|
|
30909
31197
|
return;
|
|
30910
31198
|
}
|
|
@@ -30922,7 +31210,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
30922
31210
|
awarenessInstance.off("change", updateUsers);
|
|
30923
31211
|
};
|
|
30924
31212
|
}, [awarenessInstance, connectionStatus]);
|
|
30925
|
-
|
|
31213
|
+
useEffect104(() => {
|
|
30926
31214
|
if (!awarenessInstance || connectionStatus !== "connected") {
|
|
30927
31215
|
return;
|
|
30928
31216
|
}
|
|
@@ -30951,7 +31239,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
30951
31239
|
};
|
|
30952
31240
|
}, [awarenessInstance, connectionStatus, memoizedUser.id, memoizedUser.name, memoizedUser.color, memoizedUser.avatar]);
|
|
30953
31241
|
const dmSentRef = useRef26(false);
|
|
30954
|
-
|
|
31242
|
+
useEffect104(() => {
|
|
30955
31243
|
if (!ixoEditor || connectionStatus !== "connected" || dmSentRef.current) return;
|
|
30956
31244
|
if (ixoEditor.docType !== "flow") return;
|
|
30957
31245
|
const mx = ixoEditor.getMatrixClient?.();
|
|
@@ -30960,10 +31248,10 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
30960
31248
|
if (!mx || !runtime || !currentUserId) return;
|
|
30961
31249
|
dmSentRef.current = true;
|
|
30962
31250
|
const sendNotifications = async () => {
|
|
30963
|
-
const blocks = ixoEditor
|
|
31251
|
+
const blocks = ixoEditor?.document || [];
|
|
30964
31252
|
const dedupState = getDMNotificationState(runtime);
|
|
30965
|
-
const flowTitle = ixoEditor
|
|
30966
|
-
const roomId = ixoEditor
|
|
31253
|
+
const flowTitle = ixoEditor?.getFlowMetadata?.()?.title || "Untitled Flow";
|
|
31254
|
+
const roomId = ixoEditor?.getRoomId?.() || "";
|
|
30967
31255
|
const selfDid = currentUserId.split(":")[0].replace("@", "").replace(/-/g, ":");
|
|
30968
31256
|
const notifications = [];
|
|
30969
31257
|
for (const block of blocks) {
|
|
@@ -31016,15 +31304,15 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31016
31304
|
}
|
|
31017
31305
|
|
|
31018
31306
|
// src/mantine/IxoEditor.tsx
|
|
31019
|
-
import
|
|
31307
|
+
import React294, { useState as useState133, useEffect as useEffect110, useCallback as useCallback107 } from "react";
|
|
31020
31308
|
import { SuggestionMenuController } from "@blocknote/react";
|
|
31021
31309
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
31022
31310
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
31023
31311
|
import { MantineProvider } from "@mantine/core";
|
|
31024
31312
|
|
|
31025
31313
|
// src/mantine/components/PanelContent.tsx
|
|
31026
|
-
import
|
|
31027
|
-
import { Box as
|
|
31314
|
+
import React286 from "react";
|
|
31315
|
+
import { Box as Box56 } from "@mantine/core";
|
|
31028
31316
|
var panelStyles = {
|
|
31029
31317
|
light: {
|
|
31030
31318
|
backgroundColor: "#ffffff",
|
|
@@ -31053,8 +31341,8 @@ function PanelContent({ theme }) {
|
|
|
31053
31341
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
31054
31342
|
const isOpen = activePanel !== null;
|
|
31055
31343
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
31056
|
-
return /* @__PURE__ */
|
|
31057
|
-
|
|
31344
|
+
return /* @__PURE__ */ React286.createElement(
|
|
31345
|
+
Box56,
|
|
31058
31346
|
{
|
|
31059
31347
|
pos: "sticky",
|
|
31060
31348
|
right: 0,
|
|
@@ -31073,8 +31361,8 @@ function PanelContent({ theme }) {
|
|
|
31073
31361
|
}
|
|
31074
31362
|
|
|
31075
31363
|
// src/mantine/components/CoverImage.tsx
|
|
31076
|
-
import
|
|
31077
|
-
import { Box as
|
|
31364
|
+
import React291, { useState as useState130, useRef as useRef27, useEffect as useEffect107, useMemo as useMemo119 } from "react";
|
|
31365
|
+
import { Box as Box60, Group as Group107 } from "@mantine/core";
|
|
31078
31366
|
|
|
31079
31367
|
// src/core/lib/imageTransform.ts
|
|
31080
31368
|
var CLOUDFLARE_CDN_BASE = "https://www.ixo.earth/cdn-cgi/image";
|
|
@@ -31207,9 +31495,9 @@ function transformIconImage(sourceUrl, size = "default", customOptions) {
|
|
|
31207
31495
|
}
|
|
31208
31496
|
|
|
31209
31497
|
// src/mantine/components/Base/CoverImageButton.tsx
|
|
31210
|
-
import
|
|
31498
|
+
import React287, { forwardRef } from "react";
|
|
31211
31499
|
import { Button as Button51 } from "@mantine/core";
|
|
31212
|
-
var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style, ...props }, ref) => /* @__PURE__ */
|
|
31500
|
+
var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style, ...props }, ref) => /* @__PURE__ */ React287.createElement(
|
|
31213
31501
|
Button51,
|
|
31214
31502
|
{
|
|
31215
31503
|
ref,
|
|
@@ -31232,8 +31520,8 @@ var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style,
|
|
|
31232
31520
|
CoverImageButton.displayName = "CoverImageButton";
|
|
31233
31521
|
|
|
31234
31522
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
31235
|
-
import
|
|
31236
|
-
import { TextInput as TextInput8, Tabs as Tabs4, Box as
|
|
31523
|
+
import React288, { useState as useState128, useMemo as useMemo117, useEffect as useEffect105 } from "react";
|
|
31524
|
+
import { TextInput as TextInput8, Tabs as Tabs4, Box as Box57, Stack as Stack194, UnstyledButton as UnstyledButton5, Text as Text165, Center as Center13, ScrollArea as ScrollArea9, Group as Group105, Popover as Popover6 } from "@mantine/core";
|
|
31237
31525
|
import * as TablerIcons from "@tabler/icons-react";
|
|
31238
31526
|
import { IconSearch as IconSearch7, IconX as IconX14, IconChevronLeft, IconChevronRight as IconChevronRight14 } from "@tabler/icons-react";
|
|
31239
31527
|
|
|
@@ -31265,28 +31553,28 @@ var localStorageService = {
|
|
|
31265
31553
|
var iconsKey = "editor_recent_icons";
|
|
31266
31554
|
var ICONS_PER_PAGE = 500;
|
|
31267
31555
|
function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children, currentIcon }) {
|
|
31268
|
-
const [searchQuery, setSearchQuery] =
|
|
31269
|
-
const [activeTab, setActiveTab] =
|
|
31270
|
-
const [currentPage, setCurrentPage] =
|
|
31271
|
-
const allIcons =
|
|
31556
|
+
const [searchQuery, setSearchQuery] = useState128("");
|
|
31557
|
+
const [activeTab, setActiveTab] = useState128("icons");
|
|
31558
|
+
const [currentPage, setCurrentPage] = useState128(1);
|
|
31559
|
+
const allIcons = useMemo117(() => {
|
|
31272
31560
|
const iconEntries = Object.entries(TablerIcons).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
31273
31561
|
return iconEntries;
|
|
31274
31562
|
}, []);
|
|
31275
|
-
const filteredIcons =
|
|
31563
|
+
const filteredIcons = useMemo117(() => {
|
|
31276
31564
|
if (!searchQuery) return allIcons;
|
|
31277
31565
|
const query = searchQuery.toLowerCase();
|
|
31278
31566
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
31279
31567
|
}, [allIcons, searchQuery]);
|
|
31280
|
-
|
|
31568
|
+
useEffect105(() => {
|
|
31281
31569
|
setCurrentPage(1);
|
|
31282
31570
|
}, [searchQuery]);
|
|
31283
|
-
const paginatedIcons =
|
|
31571
|
+
const paginatedIcons = useMemo117(() => {
|
|
31284
31572
|
const startIndex = (currentPage - 1) * ICONS_PER_PAGE;
|
|
31285
31573
|
const endIndex = startIndex + ICONS_PER_PAGE;
|
|
31286
31574
|
return filteredIcons.slice(startIndex, endIndex);
|
|
31287
31575
|
}, [filteredIcons, currentPage]);
|
|
31288
31576
|
const totalPages = Math.ceil(filteredIcons.length / ICONS_PER_PAGE);
|
|
31289
|
-
const recentIcons =
|
|
31577
|
+
const recentIcons = useMemo117(() => {
|
|
31290
31578
|
const recentIconNames = localStorageService.get(iconsKey);
|
|
31291
31579
|
if (!recentIconNames || recentIconNames.length === 0) return [];
|
|
31292
31580
|
return recentIconNames.slice(0, 24).map((iconName) => allIcons.find(([name]) => name === iconName)).filter((entry) => entry !== void 0);
|
|
@@ -31301,10 +31589,10 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
31301
31589
|
};
|
|
31302
31590
|
const renderIconGrid = (icons) => {
|
|
31303
31591
|
if (icons.length === 0) {
|
|
31304
|
-
return /* @__PURE__ */
|
|
31592
|
+
return /* @__PURE__ */ React288.createElement(Center13, { py: "xl" }, /* @__PURE__ */ React288.createElement(Text165, { c: "dimmed", size: "sm" }, "No icons found"));
|
|
31305
31593
|
}
|
|
31306
|
-
return /* @__PURE__ */
|
|
31307
|
-
|
|
31594
|
+
return /* @__PURE__ */ React288.createElement(
|
|
31595
|
+
Box57,
|
|
31308
31596
|
{
|
|
31309
31597
|
style: {
|
|
31310
31598
|
display: "grid",
|
|
@@ -31315,7 +31603,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
31315
31603
|
},
|
|
31316
31604
|
icons.map(([name, IconComponent]) => {
|
|
31317
31605
|
const isSelected = currentIcon === name.replace("Icon", "").replace(/([A-Z])/g, "-$1").toLowerCase().slice(1);
|
|
31318
|
-
return /* @__PURE__ */
|
|
31606
|
+
return /* @__PURE__ */ React288.createElement(
|
|
31319
31607
|
UnstyledButton5,
|
|
31320
31608
|
{
|
|
31321
31609
|
key: name,
|
|
@@ -31341,12 +31629,12 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
31341
31629
|
}
|
|
31342
31630
|
}
|
|
31343
31631
|
},
|
|
31344
|
-
/* @__PURE__ */
|
|
31632
|
+
/* @__PURE__ */ React288.createElement(IconComponent, { color: "white", size: 24, stroke: 1.5 })
|
|
31345
31633
|
);
|
|
31346
31634
|
})
|
|
31347
31635
|
);
|
|
31348
31636
|
};
|
|
31349
|
-
return /* @__PURE__ */
|
|
31637
|
+
return /* @__PURE__ */ React288.createElement(Popover6, { opened, onClose, position: "right", width: 500, shadow: "xl" }, /* @__PURE__ */ React288.createElement(Popover6.Target, null, children), /* @__PURE__ */ React288.createElement(
|
|
31350
31638
|
Popover6.Dropdown,
|
|
31351
31639
|
{
|
|
31352
31640
|
style: {
|
|
@@ -31356,15 +31644,15 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
31356
31644
|
},
|
|
31357
31645
|
p: 0
|
|
31358
31646
|
},
|
|
31359
|
-
/* @__PURE__ */
|
|
31647
|
+
/* @__PURE__ */ React288.createElement(Stack194, { gap: "md", p: "md" }, /* @__PURE__ */ React288.createElement(Tabs4, { value: activeTab, onChange: setActiveTab, variant: "pills" }, /* @__PURE__ */ React288.createElement(Tabs4.List, null, /* @__PURE__ */ React288.createElement(Tabs4.Tab, { value: "icons" }, "Icons"), /* @__PURE__ */ React288.createElement(Tabs4.Tab, { value: "upload" }, "Upload")), /* @__PURE__ */ React288.createElement(Tabs4.Panel, { value: "icons", pt: "md" }, /* @__PURE__ */ React288.createElement(
|
|
31360
31648
|
TextInput8,
|
|
31361
31649
|
{
|
|
31362
31650
|
mb: "md",
|
|
31363
31651
|
placeholder: "Filter",
|
|
31364
|
-
leftSection: /* @__PURE__ */
|
|
31652
|
+
leftSection: /* @__PURE__ */ React288.createElement(IconSearch7, { size: 18 }),
|
|
31365
31653
|
value: searchQuery,
|
|
31366
31654
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
31367
|
-
rightSection: searchQuery && /* @__PURE__ */
|
|
31655
|
+
rightSection: searchQuery && /* @__PURE__ */ React288.createElement(UnstyledButton5, { onClick: () => setSearchQuery("") }, /* @__PURE__ */ React288.createElement(IconX14, { size: 18 })),
|
|
31368
31656
|
style: { flex: 1 },
|
|
31369
31657
|
styles: {
|
|
31370
31658
|
input: {
|
|
@@ -31374,26 +31662,26 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
31374
31662
|
}
|
|
31375
31663
|
}
|
|
31376
31664
|
}
|
|
31377
|
-
), !searchQuery && /* @__PURE__ */
|
|
31665
|
+
), !searchQuery && /* @__PURE__ */ React288.createElement(Box57, { mb: "md" }, /* @__PURE__ */ React288.createElement(Text165, { size: "sm", fw: 500, mb: "xs", px: "xs" }, "Recent"), /* @__PURE__ */ React288.createElement(ScrollArea9.Autosize, { scrollbarSize: 0, mah: 60 }, renderIconGrid(recentIcons))), /* @__PURE__ */ React288.createElement(Box57, null, /* @__PURE__ */ React288.createElement(Group105, { justify: "space-between", mb: "xs", px: "xs" }, /* @__PURE__ */ React288.createElement(Text165, { size: "sm", fw: 500 }, searchQuery ? "Results" : "Icons"), totalPages > 1 && /* @__PURE__ */ React288.createElement(Group105, { gap: "xs" }, /* @__PURE__ */ React288.createElement(Text165, { size: "xs", c: "dimmed" }, "Page ", currentPage, " of ", totalPages, " (", filteredIcons.length, " total)"), /* @__PURE__ */ React288.createElement(BaseButton, { size: "xs", onClick: () => setCurrentPage((p) => Math.max(1, p - 1)), disabled: currentPage === 1, leftSection: /* @__PURE__ */ React288.createElement(IconChevronLeft, { size: 14 }) }, "Prev"), /* @__PURE__ */ React288.createElement(
|
|
31378
31666
|
BaseButton,
|
|
31379
31667
|
{
|
|
31380
31668
|
size: "xs",
|
|
31381
31669
|
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
31382
31670
|
disabled: currentPage === totalPages,
|
|
31383
|
-
leftSection: /* @__PURE__ */
|
|
31671
|
+
leftSection: /* @__PURE__ */ React288.createElement(IconChevronRight14, { size: 14 })
|
|
31384
31672
|
},
|
|
31385
31673
|
"Next"
|
|
31386
|
-
))), /* @__PURE__ */
|
|
31674
|
+
))), /* @__PURE__ */ React288.createElement(ScrollArea9.Autosize, { scrollbarSize: 0, mah: 200 }, renderIconGrid(paginatedIcons)))), /* @__PURE__ */ React288.createElement(Tabs4.Panel, { value: "upload", pt: "md" }, /* @__PURE__ */ React288.createElement(Center13, { py: "xl" }, /* @__PURE__ */ React288.createElement(Stack194, { align: "center", gap: "md" }, /* @__PURE__ */ React288.createElement(Text165, { size: "sm", c: "dimmed", ta: "center" }, "Upload a custom icon image", /* @__PURE__ */ React288.createElement("br", null), "(PNG, JPG, SVG)"), /* @__PURE__ */ React288.createElement(CoverImageButton, { onClick: onUploadClick }, "Choose File"))))))
|
|
31387
31675
|
));
|
|
31388
31676
|
}
|
|
31389
31677
|
|
|
31390
31678
|
// src/mantine/components/Base/PageIcon.tsx
|
|
31391
|
-
import
|
|
31392
|
-
import { Center as Center14, Box as
|
|
31679
|
+
import React289, { useMemo as useMemo118 } from "react";
|
|
31680
|
+
import { Center as Center14, Box as Box58 } from "@mantine/core";
|
|
31393
31681
|
import * as TablerIcons2 from "@tabler/icons-react";
|
|
31394
31682
|
function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
31395
31683
|
const isIconName = src && !src.startsWith("http");
|
|
31396
|
-
const IconComponent =
|
|
31684
|
+
const IconComponent = useMemo118(() => {
|
|
31397
31685
|
if (!isIconName || !src) return null;
|
|
31398
31686
|
const iconComponent = TablerIcons2[src];
|
|
31399
31687
|
if (iconComponent) {
|
|
@@ -31401,10 +31689,10 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
31401
31689
|
}
|
|
31402
31690
|
return null;
|
|
31403
31691
|
}, [isIconName, src]);
|
|
31404
|
-
const Container = useCenter ? Center14 :
|
|
31692
|
+
const Container = useCenter ? Center14 : Box58;
|
|
31405
31693
|
if (!src) return null;
|
|
31406
31694
|
if (IconComponent) {
|
|
31407
|
-
return /* @__PURE__ */
|
|
31695
|
+
return /* @__PURE__ */ React289.createElement(
|
|
31408
31696
|
Container,
|
|
31409
31697
|
{
|
|
31410
31698
|
style: {
|
|
@@ -31416,10 +31704,10 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
31416
31704
|
...style
|
|
31417
31705
|
}
|
|
31418
31706
|
},
|
|
31419
|
-
/* @__PURE__ */
|
|
31707
|
+
/* @__PURE__ */ React289.createElement(IconComponent, { size: iconSize, color: "white", stroke: 1.5 })
|
|
31420
31708
|
);
|
|
31421
31709
|
}
|
|
31422
|
-
return /* @__PURE__ */
|
|
31710
|
+
return /* @__PURE__ */ React289.createElement(
|
|
31423
31711
|
"img",
|
|
31424
31712
|
{
|
|
31425
31713
|
src,
|
|
@@ -31440,14 +31728,14 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
31440
31728
|
import { useDisclosure as useDisclosure7 } from "@mantine/hooks";
|
|
31441
31729
|
|
|
31442
31730
|
// src/mantine/components/FlowSettingsPanel.tsx
|
|
31443
|
-
import
|
|
31444
|
-
import { Stack as
|
|
31731
|
+
import React290, { useState as useState129, useEffect as useEffect106, useCallback as useCallback105 } from "react";
|
|
31732
|
+
import { Stack as Stack195, Group as Group106, Button as Button52, ActionIcon as ActionIcon37, Text as Text166, Box as Box59 } from "@mantine/core";
|
|
31445
31733
|
import { IconPlus as IconPlus11, IconTrash as IconTrash10 } from "@tabler/icons-react";
|
|
31446
31734
|
var SYSTEM_KEYS = /* @__PURE__ */ new Set(["@context", "_type", "schema_version", "doc_id", "title", "createdAt", "createdBy", "flowOwnerDid"]);
|
|
31447
31735
|
var FlowSettingsPanel = ({ editor }) => {
|
|
31448
31736
|
const { closePanel } = usePanelStore();
|
|
31449
|
-
const [rows, setRows] =
|
|
31450
|
-
const loadSettings =
|
|
31737
|
+
const [rows, setRows] = useState129([]);
|
|
31738
|
+
const loadSettings = useCallback105(() => {
|
|
31451
31739
|
const metadata = editor.getFlowMetadata?.();
|
|
31452
31740
|
if (!metadata) return;
|
|
31453
31741
|
const customRows = [];
|
|
@@ -31458,10 +31746,10 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
31458
31746
|
}
|
|
31459
31747
|
setRows(customRows);
|
|
31460
31748
|
}, [editor]);
|
|
31461
|
-
|
|
31749
|
+
useEffect106(() => {
|
|
31462
31750
|
loadSettings();
|
|
31463
31751
|
}, [loadSettings]);
|
|
31464
|
-
const handleKeyChange =
|
|
31752
|
+
const handleKeyChange = useCallback105(
|
|
31465
31753
|
(index, newKey) => {
|
|
31466
31754
|
setRows((prev) => {
|
|
31467
31755
|
const updated = [...prev];
|
|
@@ -31478,7 +31766,7 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
31478
31766
|
},
|
|
31479
31767
|
[editor]
|
|
31480
31768
|
);
|
|
31481
|
-
const handleValueChange =
|
|
31769
|
+
const handleValueChange = useCallback105(
|
|
31482
31770
|
(index, newValue) => {
|
|
31483
31771
|
setRows((prev) => {
|
|
31484
31772
|
const updated = [...prev];
|
|
@@ -31492,10 +31780,10 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
31492
31780
|
},
|
|
31493
31781
|
[editor]
|
|
31494
31782
|
);
|
|
31495
|
-
const handleAdd =
|
|
31783
|
+
const handleAdd = useCallback105(() => {
|
|
31496
31784
|
setRows((prev) => [...prev, { key: "", value: "" }]);
|
|
31497
31785
|
}, []);
|
|
31498
|
-
const handleDelete =
|
|
31786
|
+
const handleDelete = useCallback105(
|
|
31499
31787
|
(index) => {
|
|
31500
31788
|
setRows((prev) => {
|
|
31501
31789
|
const row = prev[index];
|
|
@@ -31507,23 +31795,23 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
31507
31795
|
},
|
|
31508
31796
|
[editor]
|
|
31509
31797
|
);
|
|
31510
|
-
const subtitle = /* @__PURE__ */
|
|
31511
|
-
return /* @__PURE__ */
|
|
31798
|
+
const subtitle = /* @__PURE__ */ React290.createElement(Box59, { px: 40, mb: "md" }, /* @__PURE__ */ React290.createElement(Text166, { size: "sm", c: "dimmed" }, "Add key-value settings for this flow. These are available to oracles and action blocks at runtime."));
|
|
31799
|
+
return /* @__PURE__ */ React290.createElement(BaseRightPanelLayout, { title: "Flow Settings", onClose: closePanel, isTemplate: true, captionContent: subtitle }, /* @__PURE__ */ React290.createElement(Stack195, { gap: "lg" }, rows.map((row, index) => /* @__PURE__ */ React290.createElement(Stack195, { key: index, gap: "xs" }, /* @__PURE__ */ React290.createElement(Group106, { gap: "xs", align: "center", wrap: "nowrap" }, /* @__PURE__ */ React290.createElement(BaseTextInput, { placeholder: "Key (e.g. protocolDid)", value: row.key, onChange: (e) => handleKeyChange(index, e.currentTarget.value), style: { flex: 1 } }), /* @__PURE__ */ React290.createElement(ActionIcon37, { variant: "subtle", color: "red", onClick: () => handleDelete(index), size: "lg" }, /* @__PURE__ */ React290.createElement(IconTrash10, { size: 16 }))), /* @__PURE__ */ React290.createElement(BaseTextArea, { placeholder: "Value", value: row.value, onChange: (e) => handleValueChange(index, e.currentTarget.value), minRows: 1, maxRows: 8 }))), /* @__PURE__ */ React290.createElement(Button52, { variant: "subtle", leftSection: /* @__PURE__ */ React290.createElement(IconPlus11, { size: 16 }), onClick: handleAdd, size: "sm" }, "Add setting")));
|
|
31512
31800
|
};
|
|
31513
31801
|
|
|
31514
31802
|
// src/mantine/components/CoverImage.tsx
|
|
31515
31803
|
function CoverImage({ coverImageUrl, logoUrl }) {
|
|
31516
31804
|
const { editor, handlers, editable } = useBlocknoteContext();
|
|
31517
|
-
const [isHovering, setIsHovering] =
|
|
31518
|
-
const [isRepositioning, setIsRepositioning] =
|
|
31519
|
-
const [coverPosition, setCoverPosition] =
|
|
31805
|
+
const [isHovering, setIsHovering] = useState130(false);
|
|
31806
|
+
const [isRepositioning, setIsRepositioning] = useState130(false);
|
|
31807
|
+
const [coverPosition, setCoverPosition] = useState130(() => editor?.getPageMetadata?.()?.coverPosition ?? 50);
|
|
31520
31808
|
const coverFileInputRef = useRef27(null);
|
|
31521
31809
|
const logoFileInputRef = useRef27(null);
|
|
31522
31810
|
const [opened, { open, close }] = useDisclosure7(false);
|
|
31523
|
-
const [metadata, setMetadata] =
|
|
31524
|
-
const settingsPanelContent =
|
|
31811
|
+
const [metadata, setMetadata] = useState130(() => editor?.getPageMetadata?.() || null);
|
|
31812
|
+
const settingsPanelContent = useMemo119(() => editor ? /* @__PURE__ */ React291.createElement(FlowSettingsPanel, { editor }) : null, [editor]);
|
|
31525
31813
|
const { open: openSettings } = usePanel("flow-settings-panel", settingsPanelContent);
|
|
31526
|
-
|
|
31814
|
+
useEffect107(() => {
|
|
31527
31815
|
if (!editor?._metadataManager) {
|
|
31528
31816
|
return;
|
|
31529
31817
|
}
|
|
@@ -31611,8 +31899,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31611
31899
|
return null;
|
|
31612
31900
|
}
|
|
31613
31901
|
if (!hasCover) {
|
|
31614
|
-
return /* @__PURE__ */
|
|
31615
|
-
|
|
31902
|
+
return /* @__PURE__ */ React291.createElement(
|
|
31903
|
+
Box60,
|
|
31616
31904
|
{
|
|
31617
31905
|
style: {
|
|
31618
31906
|
position: "relative",
|
|
@@ -31624,8 +31912,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31624
31912
|
onMouseEnter: () => editable && setIsHovering(true),
|
|
31625
31913
|
onMouseLeave: () => editable && setIsHovering(false)
|
|
31626
31914
|
},
|
|
31627
|
-
/* @__PURE__ */
|
|
31628
|
-
|
|
31915
|
+
/* @__PURE__ */ React291.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "relative", height: "100%" } }, /* @__PURE__ */ React291.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }), /* @__PURE__ */ React291.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") }), editable && isHovering && !logoSrc && /* @__PURE__ */ React291.createElement(
|
|
31916
|
+
Group107,
|
|
31629
31917
|
{
|
|
31630
31918
|
gap: "xs",
|
|
31631
31919
|
style: {
|
|
@@ -31635,7 +31923,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31635
31923
|
zIndex: 10
|
|
31636
31924
|
}
|
|
31637
31925
|
},
|
|
31638
|
-
/* @__PURE__ */
|
|
31926
|
+
/* @__PURE__ */ React291.createElement(
|
|
31639
31927
|
BaseIconPicker,
|
|
31640
31928
|
{
|
|
31641
31929
|
opened,
|
|
@@ -31644,12 +31932,12 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31644
31932
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
31645
31933
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
31646
31934
|
},
|
|
31647
|
-
/* @__PURE__ */
|
|
31935
|
+
/* @__PURE__ */ React291.createElement(CoverImageButton, { onClick: open }, "Add icon")
|
|
31648
31936
|
),
|
|
31649
|
-
/* @__PURE__ */
|
|
31650
|
-
/* @__PURE__ */
|
|
31651
|
-
), logoSrc && /* @__PURE__ */
|
|
31652
|
-
|
|
31937
|
+
/* @__PURE__ */ React291.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Add cover"),
|
|
31938
|
+
/* @__PURE__ */ React291.createElement(CoverImageButton, { onClick: openSettings }, "Settings")
|
|
31939
|
+
), logoSrc && /* @__PURE__ */ React291.createElement(
|
|
31940
|
+
Box60,
|
|
31653
31941
|
{
|
|
31654
31942
|
style: {
|
|
31655
31943
|
position: "relative",
|
|
@@ -31662,8 +31950,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31662
31950
|
zIndex: 11
|
|
31663
31951
|
}
|
|
31664
31952
|
},
|
|
31665
|
-
/* @__PURE__ */
|
|
31666
|
-
editable && isHovering && /* @__PURE__ */
|
|
31953
|
+
/* @__PURE__ */ React291.createElement(PageIcon, { src: logoSrc, useCenter: true, iconSize: 64 }),
|
|
31954
|
+
editable && isHovering && /* @__PURE__ */ React291.createElement(
|
|
31667
31955
|
"div",
|
|
31668
31956
|
{
|
|
31669
31957
|
style: {
|
|
@@ -31678,7 +31966,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31678
31966
|
alignItems: "center"
|
|
31679
31967
|
}
|
|
31680
31968
|
},
|
|
31681
|
-
/* @__PURE__ */
|
|
31969
|
+
/* @__PURE__ */ React291.createElement(
|
|
31682
31970
|
BaseIconPicker,
|
|
31683
31971
|
{
|
|
31684
31972
|
opened,
|
|
@@ -31687,17 +31975,17 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31687
31975
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
31688
31976
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
31689
31977
|
},
|
|
31690
|
-
/* @__PURE__ */
|
|
31978
|
+
/* @__PURE__ */ React291.createElement(CoverImageButton, { onClick: open }, "Change")
|
|
31691
31979
|
),
|
|
31692
|
-
/* @__PURE__ */
|
|
31693
|
-
/* @__PURE__ */
|
|
31694
|
-
/* @__PURE__ */
|
|
31980
|
+
/* @__PURE__ */ React291.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove"),
|
|
31981
|
+
/* @__PURE__ */ React291.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Add cover"),
|
|
31982
|
+
/* @__PURE__ */ React291.createElement(CoverImageButton, { onClick: openSettings }, "Settings")
|
|
31695
31983
|
)
|
|
31696
31984
|
))
|
|
31697
31985
|
);
|
|
31698
31986
|
}
|
|
31699
|
-
return /* @__PURE__ */
|
|
31700
|
-
|
|
31987
|
+
return /* @__PURE__ */ React291.createElement(
|
|
31988
|
+
Box60,
|
|
31701
31989
|
{
|
|
31702
31990
|
style: {
|
|
31703
31991
|
position: "relative",
|
|
@@ -31724,7 +32012,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31724
32012
|
}
|
|
31725
32013
|
}
|
|
31726
32014
|
},
|
|
31727
|
-
/* @__PURE__ */
|
|
32015
|
+
/* @__PURE__ */ React291.createElement(
|
|
31728
32016
|
"img",
|
|
31729
32017
|
{
|
|
31730
32018
|
src: coverUrl,
|
|
@@ -31742,8 +32030,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31742
32030
|
}
|
|
31743
32031
|
}
|
|
31744
32032
|
),
|
|
31745
|
-
editable && isHovering && /* @__PURE__ */
|
|
31746
|
-
|
|
32033
|
+
editable && isHovering && /* @__PURE__ */ React291.createElement(
|
|
32034
|
+
Group107,
|
|
31747
32035
|
{
|
|
31748
32036
|
gap: "xs",
|
|
31749
32037
|
style: {
|
|
@@ -31753,8 +32041,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31753
32041
|
zIndex: 10
|
|
31754
32042
|
}
|
|
31755
32043
|
},
|
|
31756
|
-
/* @__PURE__ */
|
|
31757
|
-
/* @__PURE__ */
|
|
32044
|
+
/* @__PURE__ */ React291.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Change cover"),
|
|
32045
|
+
/* @__PURE__ */ React291.createElement(
|
|
31758
32046
|
CoverImageButton,
|
|
31759
32047
|
{
|
|
31760
32048
|
onClick: () => {
|
|
@@ -31767,11 +32055,11 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31767
32055
|
},
|
|
31768
32056
|
isRepositioning ? "Done" : "Reposition"
|
|
31769
32057
|
),
|
|
31770
|
-
/* @__PURE__ */
|
|
31771
|
-
/* @__PURE__ */
|
|
32058
|
+
/* @__PURE__ */ React291.createElement(CoverImageButton, { onClick: handleRemoveCover }, "Remove"),
|
|
32059
|
+
/* @__PURE__ */ React291.createElement(CoverImageButton, { onClick: openSettings }, "Settings")
|
|
31772
32060
|
),
|
|
31773
|
-
/* @__PURE__ */
|
|
31774
|
-
|
|
32061
|
+
/* @__PURE__ */ React291.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: 0, right: 0, height: "70px" } }, /* @__PURE__ */ React291.createElement(
|
|
32062
|
+
Box60,
|
|
31775
32063
|
{
|
|
31776
32064
|
style: {
|
|
31777
32065
|
position: "absolute",
|
|
@@ -31782,9 +32070,9 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31782
32070
|
zIndex: 11
|
|
31783
32071
|
}
|
|
31784
32072
|
},
|
|
31785
|
-
logoSrc && /* @__PURE__ */
|
|
31786
|
-
editable && isHovering && /* @__PURE__ */
|
|
31787
|
-
|
|
32073
|
+
logoSrc && /* @__PURE__ */ React291.createElement(PageIcon, { src: logoSrc, useCenter: true, iconSize: 64 }),
|
|
32074
|
+
editable && isHovering && /* @__PURE__ */ React291.createElement(React291.Fragment, null, logoSrc ? /* @__PURE__ */ React291.createElement(
|
|
32075
|
+
Group107,
|
|
31788
32076
|
{
|
|
31789
32077
|
gap: "xs",
|
|
31790
32078
|
style: {
|
|
@@ -31794,7 +32082,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31794
32082
|
zIndex: 12
|
|
31795
32083
|
}
|
|
31796
32084
|
},
|
|
31797
|
-
/* @__PURE__ */
|
|
32085
|
+
/* @__PURE__ */ React291.createElement(
|
|
31798
32086
|
BaseIconPicker,
|
|
31799
32087
|
{
|
|
31800
32088
|
opened,
|
|
@@ -31803,10 +32091,10 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31803
32091
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
31804
32092
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
31805
32093
|
},
|
|
31806
|
-
/* @__PURE__ */
|
|
32094
|
+
/* @__PURE__ */ React291.createElement(CoverImageButton, { onClick: open }, "Change")
|
|
31807
32095
|
),
|
|
31808
|
-
/* @__PURE__ */
|
|
31809
|
-
) : /* @__PURE__ */
|
|
32096
|
+
/* @__PURE__ */ React291.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove")
|
|
32097
|
+
) : /* @__PURE__ */ React291.createElement(
|
|
31810
32098
|
BaseIconPicker,
|
|
31811
32099
|
{
|
|
31812
32100
|
opened,
|
|
@@ -31815,7 +32103,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31815
32103
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
31816
32104
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
31817
32105
|
},
|
|
31818
|
-
/* @__PURE__ */
|
|
32106
|
+
/* @__PURE__ */ React291.createElement(
|
|
31819
32107
|
CoverImageButton,
|
|
31820
32108
|
{
|
|
31821
32109
|
onClick: open,
|
|
@@ -31831,13 +32119,13 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31831
32119
|
)
|
|
31832
32120
|
))
|
|
31833
32121
|
)),
|
|
31834
|
-
/* @__PURE__ */
|
|
31835
|
-
/* @__PURE__ */
|
|
32122
|
+
/* @__PURE__ */ React291.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
|
|
32123
|
+
/* @__PURE__ */ React291.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") })
|
|
31836
32124
|
);
|
|
31837
32125
|
}
|
|
31838
32126
|
|
|
31839
32127
|
// src/mantine/components/PageHeader.tsx
|
|
31840
|
-
import
|
|
32128
|
+
import React292, { useState as useState131, useRef as useRef28, useEffect as useEffect108 } from "react";
|
|
31841
32129
|
function PageHeader({
|
|
31842
32130
|
title = "New page",
|
|
31843
32131
|
icon: icon2,
|
|
@@ -31849,11 +32137,11 @@ function PageHeader({
|
|
|
31849
32137
|
isFavorited = false,
|
|
31850
32138
|
menuItems = []
|
|
31851
32139
|
}) {
|
|
31852
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
31853
|
-
const [isPrivacyOpen, setIsPrivacyOpen] =
|
|
32140
|
+
const [isMenuOpen, setIsMenuOpen] = useState131(false);
|
|
32141
|
+
const [isPrivacyOpen, setIsPrivacyOpen] = useState131(false);
|
|
31854
32142
|
const menuRef = useRef28(null);
|
|
31855
32143
|
const privacyRef = useRef28(null);
|
|
31856
|
-
|
|
32144
|
+
useEffect108(() => {
|
|
31857
32145
|
function handleClickOutside(event) {
|
|
31858
32146
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
31859
32147
|
setIsMenuOpen(false);
|
|
@@ -31875,7 +32163,7 @@ function PageHeader({
|
|
|
31875
32163
|
setIsMenuOpen(false);
|
|
31876
32164
|
}
|
|
31877
32165
|
};
|
|
31878
|
-
return /* @__PURE__ */
|
|
32166
|
+
return /* @__PURE__ */ React292.createElement("div", { style: styles.container }, /* @__PURE__ */ React292.createElement("div", { style: styles.leftSection }, /* @__PURE__ */ React292.createElement("span", { style: styles.icon }, icon2 || "\u{1F4C4}"), /* @__PURE__ */ React292.createElement("span", { style: styles.title }, title), /* @__PURE__ */ React292.createElement("div", { style: styles.privacyContainer, ref: privacyRef }, /* @__PURE__ */ React292.createElement("button", { style: styles.privacyBadge, onClick: () => onPrivacyChange && setIsPrivacyOpen(!isPrivacyOpen) }, /* @__PURE__ */ React292.createElement("span", { style: styles.lockIcon }, isPrivate ? "\u{1F512}" : "\u{1F310}"), /* @__PURE__ */ React292.createElement("span", null, isPrivate ? "Private" : "Public"), onPrivacyChange && /* @__PURE__ */ React292.createElement("span", { style: styles.chevron }, "\u25BE")), isPrivacyOpen && onPrivacyChange && /* @__PURE__ */ React292.createElement("div", { style: styles.dropdown }, /* @__PURE__ */ React292.createElement(
|
|
31879
32167
|
"button",
|
|
31880
32168
|
{
|
|
31881
32169
|
style: {
|
|
@@ -31887,9 +32175,9 @@ function PageHeader({
|
|
|
31887
32175
|
setIsPrivacyOpen(false);
|
|
31888
32176
|
}
|
|
31889
32177
|
},
|
|
31890
|
-
/* @__PURE__ */
|
|
31891
|
-
/* @__PURE__ */
|
|
31892
|
-
), /* @__PURE__ */
|
|
32178
|
+
/* @__PURE__ */ React292.createElement("span", { style: styles.menuItemIcon }, "\u{1F512}"),
|
|
32179
|
+
/* @__PURE__ */ React292.createElement("span", null, "Private")
|
|
32180
|
+
), /* @__PURE__ */ React292.createElement(
|
|
31893
32181
|
"button",
|
|
31894
32182
|
{
|
|
31895
32183
|
style: {
|
|
@@ -31901,9 +32189,9 @@ function PageHeader({
|
|
|
31901
32189
|
setIsPrivacyOpen(false);
|
|
31902
32190
|
}
|
|
31903
32191
|
},
|
|
31904
|
-
/* @__PURE__ */
|
|
31905
|
-
/* @__PURE__ */
|
|
31906
|
-
)))), /* @__PURE__ */
|
|
32192
|
+
/* @__PURE__ */ React292.createElement("span", { style: styles.menuItemIcon }, "\u{1F310}"),
|
|
32193
|
+
/* @__PURE__ */ React292.createElement("span", null, "Public")
|
|
32194
|
+
)))), /* @__PURE__ */ React292.createElement("div", { style: styles.rightSection }, lastEdited && /* @__PURE__ */ React292.createElement("span", { style: styles.editedText }, lastEdited), onShare && /* @__PURE__ */ React292.createElement("button", { style: styles.shareButton, onClick: onShare }, "Share"), onFavorite && /* @__PURE__ */ React292.createElement("button", { style: styles.iconButton, onClick: onFavorite }, isFavorited ? "\u2605" : "\u2606"), menuItems.length > 0 && /* @__PURE__ */ React292.createElement("div", { style: styles.menuContainer, ref: menuRef }, /* @__PURE__ */ React292.createElement("button", { style: styles.menuButton, onClick: () => setIsMenuOpen(!isMenuOpen), "aria-label": "Menu" }, /* @__PURE__ */ React292.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor" }, /* @__PURE__ */ React292.createElement("circle", { cx: "3", cy: "8", r: "1.5" }), /* @__PURE__ */ React292.createElement("circle", { cx: "8", cy: "8", r: "1.5" }), /* @__PURE__ */ React292.createElement("circle", { cx: "13", cy: "8", r: "1.5" }))), isMenuOpen && /* @__PURE__ */ React292.createElement("div", { style: styles.dropdown }, menuItems.map((item, index) => /* @__PURE__ */ React292.createElement(React292.Fragment, { key: index }, item.divider && index > 0 && /* @__PURE__ */ React292.createElement("div", { style: styles.divider }), /* @__PURE__ */ React292.createElement(
|
|
31907
32195
|
"button",
|
|
31908
32196
|
{
|
|
31909
32197
|
style: {
|
|
@@ -31913,8 +32201,8 @@ function PageHeader({
|
|
|
31913
32201
|
onClick: () => handleMenuItemClick(item),
|
|
31914
32202
|
disabled: item.disabled
|
|
31915
32203
|
},
|
|
31916
|
-
item.icon && /* @__PURE__ */
|
|
31917
|
-
/* @__PURE__ */
|
|
32204
|
+
item.icon && /* @__PURE__ */ React292.createElement("span", { style: styles.menuItemIcon }, item.icon),
|
|
32205
|
+
/* @__PURE__ */ React292.createElement("span", null, item.label)
|
|
31918
32206
|
)))))));
|
|
31919
32207
|
}
|
|
31920
32208
|
var styles = {
|
|
@@ -32051,8 +32339,8 @@ var styles = {
|
|
|
32051
32339
|
};
|
|
32052
32340
|
|
|
32053
32341
|
// src/mantine/components/ExternalDropZone.tsx
|
|
32054
|
-
import
|
|
32055
|
-
import { Box as
|
|
32342
|
+
import React293, { useCallback as useCallback106, useEffect as useEffect109, useRef as useRef29, useState as useState132 } from "react";
|
|
32343
|
+
import { Box as Box61 } from "@mantine/core";
|
|
32056
32344
|
var SCROLL_ZONE_SIZE = 80;
|
|
32057
32345
|
var SCROLL_SPEED = 12;
|
|
32058
32346
|
var ExternalDropZone = ({
|
|
@@ -32065,19 +32353,19 @@ var ExternalDropZone = ({
|
|
|
32065
32353
|
children
|
|
32066
32354
|
}) => {
|
|
32067
32355
|
const containerRef = useRef29(null);
|
|
32068
|
-
const [isValidDrag, setIsValidDrag] =
|
|
32069
|
-
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] =
|
|
32070
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
32356
|
+
const [isValidDrag, setIsValidDrag] = useState132(false);
|
|
32357
|
+
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState132(false);
|
|
32358
|
+
const [indicatorStyle, setIndicatorStyle] = useState132({});
|
|
32071
32359
|
const dropPositionRef = useRef29(null);
|
|
32072
32360
|
const scrollAnimationRef = useRef29(null);
|
|
32073
32361
|
const scrollDirectionRef = useRef29(null);
|
|
32074
32362
|
const scrollContainerRef = useRef29(null);
|
|
32075
|
-
const getBlockElements =
|
|
32363
|
+
const getBlockElements = useCallback106(() => {
|
|
32076
32364
|
if (!containerRef.current) return [];
|
|
32077
32365
|
const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
|
|
32078
32366
|
return Array.from(blocks);
|
|
32079
32367
|
}, []);
|
|
32080
|
-
const getScrollContainer =
|
|
32368
|
+
const getScrollContainer = useCallback106(() => {
|
|
32081
32369
|
if (scrollContainerRef.current) return scrollContainerRef.current;
|
|
32082
32370
|
let element = containerRef.current;
|
|
32083
32371
|
while (element) {
|
|
@@ -32092,7 +32380,7 @@ var ExternalDropZone = ({
|
|
|
32092
32380
|
scrollContainerRef.current = window;
|
|
32093
32381
|
return window;
|
|
32094
32382
|
}, []);
|
|
32095
|
-
const performScroll =
|
|
32383
|
+
const performScroll = useCallback106(() => {
|
|
32096
32384
|
const container = getScrollContainer();
|
|
32097
32385
|
const direction = scrollDirectionRef.current;
|
|
32098
32386
|
if (!direction) {
|
|
@@ -32107,7 +32395,7 @@ var ExternalDropZone = ({
|
|
|
32107
32395
|
}
|
|
32108
32396
|
scrollAnimationRef.current = requestAnimationFrame(performScroll);
|
|
32109
32397
|
}, [getScrollContainer]);
|
|
32110
|
-
const startAutoScroll =
|
|
32398
|
+
const startAutoScroll = useCallback106(
|
|
32111
32399
|
(direction) => {
|
|
32112
32400
|
if (scrollDirectionRef.current === direction) return;
|
|
32113
32401
|
scrollDirectionRef.current = direction;
|
|
@@ -32117,14 +32405,14 @@ var ExternalDropZone = ({
|
|
|
32117
32405
|
},
|
|
32118
32406
|
[performScroll]
|
|
32119
32407
|
);
|
|
32120
|
-
const stopAutoScroll =
|
|
32408
|
+
const stopAutoScroll = useCallback106(() => {
|
|
32121
32409
|
scrollDirectionRef.current = null;
|
|
32122
32410
|
if (scrollAnimationRef.current) {
|
|
32123
32411
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
32124
32412
|
scrollAnimationRef.current = null;
|
|
32125
32413
|
}
|
|
32126
32414
|
}, []);
|
|
32127
|
-
const checkAutoScroll =
|
|
32415
|
+
const checkAutoScroll = useCallback106(
|
|
32128
32416
|
(clientY) => {
|
|
32129
32417
|
const container = getScrollContainer();
|
|
32130
32418
|
let containerTop;
|
|
@@ -32147,7 +32435,7 @@ var ExternalDropZone = ({
|
|
|
32147
32435
|
},
|
|
32148
32436
|
[getScrollContainer, startAutoScroll, stopAutoScroll]
|
|
32149
32437
|
);
|
|
32150
|
-
const findDropPosition =
|
|
32438
|
+
const findDropPosition = useCallback106(
|
|
32151
32439
|
(clientY) => {
|
|
32152
32440
|
const blocks = getBlockElements();
|
|
32153
32441
|
if (blocks.length === 0 || !editor?.document) return null;
|
|
@@ -32180,7 +32468,7 @@ var ExternalDropZone = ({
|
|
|
32180
32468
|
},
|
|
32181
32469
|
[getBlockElements, editor]
|
|
32182
32470
|
);
|
|
32183
|
-
const handleDragOver =
|
|
32471
|
+
const handleDragOver = useCallback106(
|
|
32184
32472
|
(e) => {
|
|
32185
32473
|
if (!e.dataTransfer.types.includes(acceptedType)) return;
|
|
32186
32474
|
e.preventDefault();
|
|
@@ -32203,7 +32491,7 @@ var ExternalDropZone = ({
|
|
|
32203
32491
|
},
|
|
32204
32492
|
[acceptedType, findDropPosition, checkAutoScroll]
|
|
32205
32493
|
);
|
|
32206
|
-
const handleDragLeave =
|
|
32494
|
+
const handleDragLeave = useCallback106(
|
|
32207
32495
|
(e) => {
|
|
32208
32496
|
if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) {
|
|
32209
32497
|
setIsValidDrag(false);
|
|
@@ -32213,7 +32501,7 @@ var ExternalDropZone = ({
|
|
|
32213
32501
|
},
|
|
32214
32502
|
[stopAutoScroll]
|
|
32215
32503
|
);
|
|
32216
|
-
const handleDrop =
|
|
32504
|
+
const handleDrop = useCallback106(
|
|
32217
32505
|
(e) => {
|
|
32218
32506
|
e.preventDefault();
|
|
32219
32507
|
e.stopPropagation();
|
|
@@ -32227,7 +32515,7 @@ var ExternalDropZone = ({
|
|
|
32227
32515
|
},
|
|
32228
32516
|
[onDrop, stopAutoScroll]
|
|
32229
32517
|
);
|
|
32230
|
-
|
|
32518
|
+
useEffect109(() => {
|
|
32231
32519
|
const handleGlobalDragEnd = () => {
|
|
32232
32520
|
setIsValidDrag(false);
|
|
32233
32521
|
dropPositionRef.current = null;
|
|
@@ -32236,7 +32524,7 @@ var ExternalDropZone = ({
|
|
|
32236
32524
|
window.addEventListener("dragend", handleGlobalDragEnd);
|
|
32237
32525
|
return () => window.removeEventListener("dragend", handleGlobalDragEnd);
|
|
32238
32526
|
}, [stopAutoScroll]);
|
|
32239
|
-
const handleOverlayMouseMove =
|
|
32527
|
+
const handleOverlayMouseMove = useCallback106(
|
|
32240
32528
|
(e) => {
|
|
32241
32529
|
setIsHoveringInPlacementMode(true);
|
|
32242
32530
|
checkAutoScroll(e.clientY);
|
|
@@ -32255,12 +32543,12 @@ var ExternalDropZone = ({
|
|
|
32255
32543
|
},
|
|
32256
32544
|
[findDropPosition, checkAutoScroll]
|
|
32257
32545
|
);
|
|
32258
|
-
const handleOverlayMouseLeave =
|
|
32546
|
+
const handleOverlayMouseLeave = useCallback106(() => {
|
|
32259
32547
|
setIsHoveringInPlacementMode(false);
|
|
32260
32548
|
dropPositionRef.current = null;
|
|
32261
32549
|
stopAutoScroll();
|
|
32262
32550
|
}, [stopAutoScroll]);
|
|
32263
|
-
const handleOverlayClick =
|
|
32551
|
+
const handleOverlayClick = useCallback106(
|
|
32264
32552
|
(e) => {
|
|
32265
32553
|
e.preventDefault();
|
|
32266
32554
|
e.stopPropagation();
|
|
@@ -32274,7 +32562,7 @@ var ExternalDropZone = ({
|
|
|
32274
32562
|
},
|
|
32275
32563
|
[onDrop, stopAutoScroll]
|
|
32276
32564
|
);
|
|
32277
|
-
const handleOverlayWheel =
|
|
32565
|
+
const handleOverlayWheel = useCallback106(
|
|
32278
32566
|
(e) => {
|
|
32279
32567
|
const container = getScrollContainer();
|
|
32280
32568
|
if (container === window) {
|
|
@@ -32285,7 +32573,7 @@ var ExternalDropZone = ({
|
|
|
32285
32573
|
},
|
|
32286
32574
|
[getScrollContainer]
|
|
32287
32575
|
);
|
|
32288
|
-
|
|
32576
|
+
useEffect109(() => {
|
|
32289
32577
|
if (!isPlacementMode) return;
|
|
32290
32578
|
const handleKeyDown = (e) => {
|
|
32291
32579
|
if (e.key === "Escape") {
|
|
@@ -32308,13 +32596,13 @@ var ExternalDropZone = ({
|
|
|
32308
32596
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
32309
32597
|
};
|
|
32310
32598
|
}, [isPlacementMode, onPlacementCancel]);
|
|
32311
|
-
|
|
32599
|
+
useEffect109(() => {
|
|
32312
32600
|
if (!isPlacementMode) {
|
|
32313
32601
|
setIsHoveringInPlacementMode(false);
|
|
32314
32602
|
dropPositionRef.current = null;
|
|
32315
32603
|
}
|
|
32316
32604
|
}, [isPlacementMode]);
|
|
32317
|
-
|
|
32605
|
+
useEffect109(() => {
|
|
32318
32606
|
const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
32319
32607
|
if (isActive) {
|
|
32320
32608
|
document.body.classList.add("external-artifact-drag-active");
|
|
@@ -32325,19 +32613,19 @@ var ExternalDropZone = ({
|
|
|
32325
32613
|
document.body.classList.remove("external-artifact-drag-active");
|
|
32326
32614
|
};
|
|
32327
32615
|
}, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
|
|
32328
|
-
|
|
32616
|
+
useEffect109(() => {
|
|
32329
32617
|
return () => {
|
|
32330
32618
|
if (scrollAnimationRef.current) {
|
|
32331
32619
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
32332
32620
|
}
|
|
32333
32621
|
};
|
|
32334
32622
|
}, []);
|
|
32335
|
-
const indicatorWithPosition = dropIndicator &&
|
|
32623
|
+
const indicatorWithPosition = dropIndicator && React293.isValidElement(dropIndicator) ? React293.cloneElement(dropIndicator, {
|
|
32336
32624
|
indicatorTop: typeof indicatorStyle.top === "number" ? indicatorStyle.top : void 0
|
|
32337
32625
|
}) : dropIndicator;
|
|
32338
32626
|
const shouldShowIndicator = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
32339
|
-
return /* @__PURE__ */
|
|
32340
|
-
|
|
32627
|
+
return /* @__PURE__ */ React293.createElement(
|
|
32628
|
+
Box61,
|
|
32341
32629
|
{
|
|
32342
32630
|
ref: containerRef,
|
|
32343
32631
|
style: {
|
|
@@ -32352,8 +32640,8 @@ var ExternalDropZone = ({
|
|
|
32352
32640
|
"data-placement-mode": isPlacementMode ? "true" : void 0
|
|
32353
32641
|
},
|
|
32354
32642
|
children,
|
|
32355
|
-
isPlacementMode && /* @__PURE__ */
|
|
32356
|
-
|
|
32643
|
+
isPlacementMode && /* @__PURE__ */ React293.createElement(
|
|
32644
|
+
Box61,
|
|
32357
32645
|
{
|
|
32358
32646
|
style: {
|
|
32359
32647
|
position: "absolute",
|
|
@@ -32372,7 +32660,7 @@ var ExternalDropZone = ({
|
|
|
32372
32660
|
onWheel: handleOverlayWheel
|
|
32373
32661
|
}
|
|
32374
32662
|
),
|
|
32375
|
-
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */
|
|
32663
|
+
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React293.createElement(Box61, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
|
|
32376
32664
|
);
|
|
32377
32665
|
};
|
|
32378
32666
|
|
|
@@ -32398,8 +32686,8 @@ function IxoEditorContent({
|
|
|
32398
32686
|
}) {
|
|
32399
32687
|
const { activePanel } = usePanelStore();
|
|
32400
32688
|
const isPanelOpen = activePanel !== null;
|
|
32401
|
-
const [isRoomPrivate, setIsRoomPrivate] =
|
|
32402
|
-
|
|
32689
|
+
const [isRoomPrivate, setIsRoomPrivate] = useState133(pageHeaderProps?.isPrivate ?? true);
|
|
32690
|
+
useEffect110(() => {
|
|
32403
32691
|
const matrixClient = editor.getMatrixClient?.();
|
|
32404
32692
|
const roomId = editor.getRoomId?.();
|
|
32405
32693
|
if (!matrixClient || !roomId) return;
|
|
@@ -32415,7 +32703,7 @@ function IxoEditorContent({
|
|
|
32415
32703
|
} catch {
|
|
32416
32704
|
}
|
|
32417
32705
|
}, [editor]);
|
|
32418
|
-
const handlePrivacyChange =
|
|
32706
|
+
const handlePrivacyChange = useCallback107(
|
|
32419
32707
|
async (makePrivate) => {
|
|
32420
32708
|
const matrixClient = editor.getMatrixClient?.();
|
|
32421
32709
|
const roomId = editor.getRoomId?.();
|
|
@@ -32436,7 +32724,7 @@ function IxoEditorContent({
|
|
|
32436
32724
|
},
|
|
32437
32725
|
[editor]
|
|
32438
32726
|
);
|
|
32439
|
-
const editorContent = /* @__PURE__ */
|
|
32727
|
+
const editorContent = /* @__PURE__ */ React294.createElement(
|
|
32440
32728
|
BlockNoteView,
|
|
32441
32729
|
{
|
|
32442
32730
|
editor,
|
|
@@ -32451,7 +32739,7 @@ function IxoEditorContent({
|
|
|
32451
32739
|
onChange,
|
|
32452
32740
|
onSelectionChange
|
|
32453
32741
|
},
|
|
32454
|
-
config.slashMenu && /* @__PURE__ */
|
|
32742
|
+
config.slashMenu && /* @__PURE__ */ React294.createElement(
|
|
32455
32743
|
SuggestionMenuController,
|
|
32456
32744
|
{
|
|
32457
32745
|
triggerCharacter: "/",
|
|
@@ -32469,7 +32757,7 @@ function IxoEditorContent({
|
|
|
32469
32757
|
),
|
|
32470
32758
|
children
|
|
32471
32759
|
);
|
|
32472
|
-
return /* @__PURE__ */
|
|
32760
|
+
return /* @__PURE__ */ React294.createElement("div", { style: { display: "flex", height: "100%", width: "100%", gap: 0 } }, /* @__PURE__ */ React294.createElement(
|
|
32473
32761
|
"div",
|
|
32474
32762
|
{
|
|
32475
32763
|
className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`,
|
|
@@ -32478,9 +32766,9 @@ function IxoEditorContent({
|
|
|
32478
32766
|
transition: "width 0.2s ease"
|
|
32479
32767
|
}
|
|
32480
32768
|
},
|
|
32481
|
-
selfNav && /* @__PURE__ */
|
|
32482
|
-
/* @__PURE__ */
|
|
32483
|
-
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */
|
|
32769
|
+
selfNav && /* @__PURE__ */ React294.createElement(PageHeader, { ...pageHeaderProps, isPrivate: isRoomPrivate, onPrivacyChange: handlePrivacyChange }),
|
|
32770
|
+
/* @__PURE__ */ React294.createElement(CoverImage, { coverImageUrl, logoUrl }),
|
|
32771
|
+
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */ React294.createElement(
|
|
32484
32772
|
ExternalDropZone,
|
|
32485
32773
|
{
|
|
32486
32774
|
editor,
|
|
@@ -32493,7 +32781,7 @@ function IxoEditorContent({
|
|
|
32493
32781
|
},
|
|
32494
32782
|
editorContent
|
|
32495
32783
|
) : editorContent
|
|
32496
|
-
), isPanelVisible && /* @__PURE__ */
|
|
32784
|
+
), isPanelVisible && /* @__PURE__ */ React294.createElement(PanelContent, { theme: config.theme }));
|
|
32497
32785
|
}
|
|
32498
32786
|
function IxoEditor({
|
|
32499
32787
|
editor,
|
|
@@ -32536,7 +32824,7 @@ function IxoEditor({
|
|
|
32536
32824
|
tableHandles: true
|
|
32537
32825
|
};
|
|
32538
32826
|
const isEditable = editable;
|
|
32539
|
-
const editorContent = /* @__PURE__ */
|
|
32827
|
+
const editorContent = /* @__PURE__ */ React294.createElement(
|
|
32540
32828
|
BlocknoteProvider,
|
|
32541
32829
|
{
|
|
32542
32830
|
editor,
|
|
@@ -32551,7 +32839,7 @@ function IxoEditor({
|
|
|
32551
32839
|
connectedUsers,
|
|
32552
32840
|
awarenessInstance
|
|
32553
32841
|
},
|
|
32554
|
-
/* @__PURE__ */
|
|
32842
|
+
/* @__PURE__ */ React294.createElement(
|
|
32555
32843
|
IxoEditorContent,
|
|
32556
32844
|
{
|
|
32557
32845
|
isPanelVisible,
|
|
@@ -32575,13 +32863,13 @@ function IxoEditor({
|
|
|
32575
32863
|
)
|
|
32576
32864
|
);
|
|
32577
32865
|
if (mantineTheme) {
|
|
32578
|
-
return /* @__PURE__ */
|
|
32866
|
+
return /* @__PURE__ */ React294.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
|
|
32579
32867
|
}
|
|
32580
32868
|
return editorContent;
|
|
32581
32869
|
}
|
|
32582
32870
|
|
|
32583
32871
|
// src/mantine/components/DebugButton.tsx
|
|
32584
|
-
import
|
|
32872
|
+
import React295 from "react";
|
|
32585
32873
|
function DebugButton({ editor }) {
|
|
32586
32874
|
const yMapToObject = (map) => {
|
|
32587
32875
|
if (!map) return null;
|
|
@@ -32608,7 +32896,7 @@ function DebugButton({ editor }) {
|
|
|
32608
32896
|
const json = JSON.stringify(dump, null, 2);
|
|
32609
32897
|
console.log("Editor Debug Dump:\n" + json);
|
|
32610
32898
|
};
|
|
32611
|
-
return /* @__PURE__ */
|
|
32899
|
+
return /* @__PURE__ */ React295.createElement(
|
|
32612
32900
|
"button",
|
|
32613
32901
|
{
|
|
32614
32902
|
onClick: handleClick,
|
|
@@ -32634,15 +32922,15 @@ function DebugButton({ editor }) {
|
|
|
32634
32922
|
}
|
|
32635
32923
|
|
|
32636
32924
|
// src/mantine/components/EntitySigningSetup.tsx
|
|
32637
|
-
import
|
|
32638
|
-
import { Modal as Modal3, Stack as
|
|
32925
|
+
import React296, { useState as useState134 } from "react";
|
|
32926
|
+
import { Modal as Modal3, Stack as Stack196, Text as Text167, TextInput as TextInput9, Button as Button53, Alert as Alert53, Group as Group108 } from "@mantine/core";
|
|
32639
32927
|
import { IconAlertCircle as IconAlertCircle20, IconCheck as IconCheck23, IconKey as IconKey2 } from "@tabler/icons-react";
|
|
32640
32928
|
var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) => {
|
|
32641
|
-
const [pin, setPin] =
|
|
32642
|
-
const [confirmPin, setConfirmPin] =
|
|
32643
|
-
const [loading, setLoading] =
|
|
32644
|
-
const [error, setError] =
|
|
32645
|
-
const [success, setSuccess] =
|
|
32929
|
+
const [pin, setPin] = useState134("");
|
|
32930
|
+
const [confirmPin, setConfirmPin] = useState134("");
|
|
32931
|
+
const [loading, setLoading] = useState134(false);
|
|
32932
|
+
const [error, setError] = useState134(null);
|
|
32933
|
+
const [success, setSuccess] = useState134(false);
|
|
32646
32934
|
const handleSetup = async () => {
|
|
32647
32935
|
if (pin.length < 4) {
|
|
32648
32936
|
setError("PIN must be at least 4 characters");
|
|
@@ -32682,15 +32970,15 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
32682
32970
|
setSuccess(false);
|
|
32683
32971
|
}
|
|
32684
32972
|
};
|
|
32685
|
-
return /* @__PURE__ */
|
|
32973
|
+
return /* @__PURE__ */ React296.createElement(
|
|
32686
32974
|
Modal3,
|
|
32687
32975
|
{
|
|
32688
32976
|
opened,
|
|
32689
32977
|
onClose: handleClose,
|
|
32690
|
-
title: /* @__PURE__ */
|
|
32978
|
+
title: /* @__PURE__ */ React296.createElement(Group108, { gap: "xs" }, /* @__PURE__ */ React296.createElement(IconKey2, { size: 20 }), /* @__PURE__ */ React296.createElement(Text167, { fw: 600 }, "Entity Signing Setup")),
|
|
32691
32979
|
size: "md"
|
|
32692
32980
|
},
|
|
32693
|
-
/* @__PURE__ */
|
|
32981
|
+
/* @__PURE__ */ React296.createElement(Stack196, { gap: "md" }, success ? /* @__PURE__ */ React296.createElement(Alert53, { color: "green", icon: /* @__PURE__ */ React296.createElement(IconCheck23, { size: 16 }) }, "Entity signing key set up successfully!") : /* @__PURE__ */ React296.createElement(React296.Fragment, null, /* @__PURE__ */ React296.createElement(Text167, { size: "sm", c: "dimmed" }, "Flow authorization requires a signing key for", " ", /* @__PURE__ */ React296.createElement(Text167, { span: true, fw: 500 }, entityName || entityDid), "."), /* @__PURE__ */ React296.createElement(Alert53, { color: "blue", variant: "light" }, /* @__PURE__ */ React296.createElement(Text167, { size: "sm" }, "This is a ", /* @__PURE__ */ React296.createElement("strong", null, "one-time setup"), " that allows flows to grant permissions without requiring wallet signatures for each delegation.")), /* @__PURE__ */ React296.createElement(Stack196, { gap: "xs" }, /* @__PURE__ */ React296.createElement(Text167, { size: "sm", fw: 500 }, "What happens:"), /* @__PURE__ */ React296.createElement(Text167, { size: "sm", c: "dimmed" }, "1. A new signing key is generated"), /* @__PURE__ */ React296.createElement(Text167, { size: "sm", c: "dimmed" }, "2. Key is registered on the entity's DID document (requires wallet)"), /* @__PURE__ */ React296.createElement(Text167, { size: "sm", c: "dimmed" }, "3. Key is stored encrypted in the entity's Matrix room")), /* @__PURE__ */ React296.createElement(
|
|
32694
32982
|
TextInput9,
|
|
32695
32983
|
{
|
|
32696
32984
|
label: "Enter PIN to encrypt signing key",
|
|
@@ -32701,20 +32989,20 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
32701
32989
|
onChange: (e) => setPin(e.currentTarget.value),
|
|
32702
32990
|
disabled: loading
|
|
32703
32991
|
}
|
|
32704
|
-
), /* @__PURE__ */
|
|
32992
|
+
), /* @__PURE__ */ React296.createElement(TextInput9, { label: "Confirm PIN", type: "password", placeholder: "Confirm PIN", value: confirmPin, onChange: (e) => setConfirmPin(e.currentTarget.value), disabled: loading }), error && /* @__PURE__ */ React296.createElement(Alert53, { color: "red", icon: /* @__PURE__ */ React296.createElement(IconAlertCircle20, { size: 16 }) }, error), /* @__PURE__ */ React296.createElement(Group108, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React296.createElement(Button53, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React296.createElement(Button53, { onClick: handleSetup, loading, leftSection: /* @__PURE__ */ React296.createElement(IconKey2, { size: 16 }) }, "Setup Entity Signing"))))
|
|
32705
32993
|
);
|
|
32706
32994
|
};
|
|
32707
32995
|
|
|
32708
32996
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
32709
|
-
import
|
|
32710
|
-
import { Stack as
|
|
32997
|
+
import React297, { useState as useState135, useEffect as useEffect111, useMemo as useMemo120 } from "react";
|
|
32998
|
+
import { Stack as Stack197, Text as Text168, Paper as Paper18, Group as Group109, Badge as Badge43, Button as Button54, ActionIcon as ActionIcon38, Loader as Loader54, Alert as Alert54, Divider as Divider29 } from "@mantine/core";
|
|
32711
32999
|
import { IconPlus as IconPlus12, IconTrash as IconTrash11, IconShieldCheck as IconShieldCheck15, IconUser as IconUser14, IconRobot as IconRobot4, IconBuilding as IconBuilding2 } from "@tabler/icons-react";
|
|
32712
33000
|
var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission, onRevokePermission, getUserDisplayName }) => {
|
|
32713
|
-
const [delegations, setDelegations] =
|
|
32714
|
-
const [loading, setLoading] =
|
|
32715
|
-
const [revoking, setRevoking] =
|
|
32716
|
-
const rootCapability =
|
|
32717
|
-
|
|
33001
|
+
const [delegations, setDelegations] = useState135([]);
|
|
33002
|
+
const [loading, setLoading] = useState135(true);
|
|
33003
|
+
const [revoking, setRevoking] = useState135(null);
|
|
33004
|
+
const rootCapability = useMemo120(() => editor.getRootCapability?.(), [editor]);
|
|
33005
|
+
useEffect111(() => {
|
|
32718
33006
|
const loadDelegations = async () => {
|
|
32719
33007
|
setLoading(true);
|
|
32720
33008
|
const allDelegations = editor.getAllDelegations?.() || [];
|
|
@@ -32753,11 +33041,11 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
32753
33041
|
const getIcon2 = (type) => {
|
|
32754
33042
|
switch (type) {
|
|
32755
33043
|
case "oracle":
|
|
32756
|
-
return /* @__PURE__ */
|
|
33044
|
+
return /* @__PURE__ */ React297.createElement(IconRobot4, { size: 16 });
|
|
32757
33045
|
case "entity":
|
|
32758
|
-
return /* @__PURE__ */
|
|
33046
|
+
return /* @__PURE__ */ React297.createElement(IconBuilding2, { size: 16 });
|
|
32759
33047
|
default:
|
|
32760
|
-
return /* @__PURE__ */
|
|
33048
|
+
return /* @__PURE__ */ React297.createElement(IconUser14, { size: 16 });
|
|
32761
33049
|
}
|
|
32762
33050
|
};
|
|
32763
33051
|
const formatCapabilities = (caps) => {
|
|
@@ -32776,32 +33064,32 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
32776
33064
|
if (date < /* @__PURE__ */ new Date()) return "Expired";
|
|
32777
33065
|
return date.toLocaleDateString();
|
|
32778
33066
|
};
|
|
32779
|
-
return /* @__PURE__ */
|
|
33067
|
+
return /* @__PURE__ */ React297.createElement(Stack197, { gap: "md" }, /* @__PURE__ */ React297.createElement(Stack197, { gap: "xs" }, /* @__PURE__ */ React297.createElement(Text168, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React297.createElement(Paper18, { p: "sm", withBorder: true }, /* @__PURE__ */ React297.createElement(Group109, { gap: "xs" }, /* @__PURE__ */ React297.createElement(IconShieldCheck15, { size: 20, color: "var(--mantine-color-green-6)" }), /* @__PURE__ */ React297.createElement(Stack197, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React297.createElement(Text168, { size: "sm", fw: 500 }, entityName || entityDid), /* @__PURE__ */ React297.createElement(Text168, { size: "xs", c: "dimmed" }, rootCapability ? `Granted: ${new Date(rootCapability.issuedAt).toLocaleDateString()}` : "Root capability not set up")), /* @__PURE__ */ React297.createElement(Badge43, { color: "green", variant: "light" }, "Entity")))), /* @__PURE__ */ React297.createElement(Divider29, { label: "Delegated Permissions", labelPosition: "center" }), loading ? /* @__PURE__ */ React297.createElement(Group109, { justify: "center", py: "xl" }, /* @__PURE__ */ React297.createElement(Loader54, { size: "sm" })) : delegations.length === 0 ? /* @__PURE__ */ React297.createElement(Alert54, { color: "gray", variant: "light" }, /* @__PURE__ */ React297.createElement(Text168, { size: "sm" }, "No permissions have been granted yet.")) : /* @__PURE__ */ React297.createElement(Stack197, { gap: "xs" }, delegations.map(({ capability, displayName, type }) => /* @__PURE__ */ React297.createElement(Paper18, { key: capability.id, p: "sm", withBorder: true }, /* @__PURE__ */ React297.createElement(Group109, { justify: "space-between" }, /* @__PURE__ */ React297.createElement(Group109, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React297.createElement(Stack197, { gap: 2 }, /* @__PURE__ */ React297.createElement(Text168, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React297.createElement(Text168, { size: "xs", c: "dimmed" }, formatCapabilities(capability.capabilities)), /* @__PURE__ */ React297.createElement(Group109, { gap: "xs" }, /* @__PURE__ */ React297.createElement(Text168, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(capability.expiration)), /* @__PURE__ */ React297.createElement(Text168, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React297.createElement(Text168, { size: "xs", c: "dimmed" }, "Granted by: ", capability.issuer === entityDid ? "Entity" : capability.issuer.slice(-8))))), /* @__PURE__ */ React297.createElement(ActionIcon38, { color: "red", variant: "subtle", onClick: () => handleRevoke(capability.id), loading: revoking === capability.id, disabled: !!revoking }, /* @__PURE__ */ React297.createElement(IconTrash11, { size: 16 })))))), /* @__PURE__ */ React297.createElement(Button54, { leftSection: /* @__PURE__ */ React297.createElement(IconPlus12, { size: 16 }), variant: "light", onClick: onGrantPermission }, "Grant Permission"));
|
|
32780
33068
|
};
|
|
32781
33069
|
|
|
32782
33070
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
32783
|
-
import
|
|
32784
|
-
import { Modal as Modal4, Stack as
|
|
33071
|
+
import React298, { useState as useState136, useCallback as useCallback108 } from "react";
|
|
33072
|
+
import { Modal as Modal4, Stack as Stack198, Text as Text169, TextInput as TextInput10, Button as Button55, Group as Group110, Radio as Radio6, Checkbox as Checkbox13, Alert as Alert55, Paper as Paper19, Loader as Loader55, Badge as Badge44, ActionIcon as ActionIcon39, Divider as Divider30, NumberInput as NumberInput3 } from "@mantine/core";
|
|
32785
33073
|
import { IconSearch as IconSearch8, IconUser as IconUser15, IconRobot as IconRobot5, IconX as IconX15, IconShieldPlus as IconShieldPlus4 } from "@tabler/icons-react";
|
|
32786
33074
|
var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, searchUsers, getOracles, onGrant }) => {
|
|
32787
33075
|
const singleBlockMode = !!targetBlockId || blocks.length === 1;
|
|
32788
33076
|
const fixedBlockId = targetBlockId || (blocks.length === 1 ? blocks[0].id : null);
|
|
32789
33077
|
const fixedBlock = fixedBlockId ? blocks.find((b) => b.id === fixedBlockId) || blocks[0] : null;
|
|
32790
|
-
const [recipientType, setRecipientType] =
|
|
32791
|
-
const [searchQuery, setSearchQuery] =
|
|
32792
|
-
const [searchResults, setSearchResults] =
|
|
32793
|
-
const [searching, setSearching] =
|
|
32794
|
-
const [selectedRecipient, setSelectedRecipient] =
|
|
32795
|
-
const [manualDid, setManualDid] =
|
|
32796
|
-
const [scopeType, setScopeType] =
|
|
32797
|
-
const [selectedBlocks, setSelectedBlocks] =
|
|
32798
|
-
const [expirationEnabled, setExpirationEnabled] =
|
|
32799
|
-
const [expirationDays, setExpirationDays] =
|
|
32800
|
-
const [canDelegate, setCanDelegate] =
|
|
32801
|
-
const [pin, setPin] =
|
|
32802
|
-
const [loading, setLoading] =
|
|
32803
|
-
const [error, setError] =
|
|
32804
|
-
const handleSearch =
|
|
33078
|
+
const [recipientType, setRecipientType] = useState136("user");
|
|
33079
|
+
const [searchQuery, setSearchQuery] = useState136("");
|
|
33080
|
+
const [searchResults, setSearchResults] = useState136([]);
|
|
33081
|
+
const [searching, setSearching] = useState136(false);
|
|
33082
|
+
const [selectedRecipient, setSelectedRecipient] = useState136(null);
|
|
33083
|
+
const [manualDid, setManualDid] = useState136("");
|
|
33084
|
+
const [scopeType, setScopeType] = useState136("full");
|
|
33085
|
+
const [selectedBlocks, setSelectedBlocks] = useState136([]);
|
|
33086
|
+
const [expirationEnabled, setExpirationEnabled] = useState136(false);
|
|
33087
|
+
const [expirationDays, setExpirationDays] = useState136(30);
|
|
33088
|
+
const [canDelegate, setCanDelegate] = useState136(false);
|
|
33089
|
+
const [pin, setPin] = useState136("");
|
|
33090
|
+
const [loading, setLoading] = useState136(false);
|
|
33091
|
+
const [error, setError] = useState136(null);
|
|
33092
|
+
const handleSearch = useCallback108(async () => {
|
|
32805
33093
|
if (searchQuery.length < 2) return;
|
|
32806
33094
|
setSearching(true);
|
|
32807
33095
|
try {
|
|
@@ -32888,15 +33176,15 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
32888
33176
|
resetForm();
|
|
32889
33177
|
}
|
|
32890
33178
|
};
|
|
32891
|
-
return /* @__PURE__ */
|
|
33179
|
+
return /* @__PURE__ */ React298.createElement(
|
|
32892
33180
|
Modal4,
|
|
32893
33181
|
{
|
|
32894
33182
|
opened,
|
|
32895
33183
|
onClose: handleClose,
|
|
32896
|
-
title: /* @__PURE__ */
|
|
33184
|
+
title: /* @__PURE__ */ React298.createElement(Group110, { gap: "xs" }, /* @__PURE__ */ React298.createElement(IconShieldPlus4, { size: 20 }), /* @__PURE__ */ React298.createElement(Text169, { fw: 600 }, "Grant Permission")),
|
|
32897
33185
|
size: "lg"
|
|
32898
33186
|
},
|
|
32899
|
-
/* @__PURE__ */
|
|
33187
|
+
/* @__PURE__ */ React298.createElement(Stack198, { gap: "md" }, /* @__PURE__ */ React298.createElement(Stack198, { gap: "xs" }, /* @__PURE__ */ React298.createElement(Text169, { size: "sm", fw: 500 }, "Recipient Type"), /* @__PURE__ */ React298.createElement(
|
|
32900
33188
|
Radio6.Group,
|
|
32901
33189
|
{
|
|
32902
33190
|
value: recipientType,
|
|
@@ -32906,23 +33194,23 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
32906
33194
|
setSearchResults([]);
|
|
32907
33195
|
}
|
|
32908
33196
|
},
|
|
32909
|
-
/* @__PURE__ */
|
|
32910
|
-
)), recipientType !== "manual" ? /* @__PURE__ */
|
|
33197
|
+
/* @__PURE__ */ React298.createElement(Group110, null, /* @__PURE__ */ React298.createElement(Radio6, { value: "user", label: "User" }), /* @__PURE__ */ React298.createElement(Radio6, { value: "oracle", label: "Oracle" }), /* @__PURE__ */ React298.createElement(Radio6, { value: "manual", label: "Enter DID" }))
|
|
33198
|
+
)), recipientType !== "manual" ? /* @__PURE__ */ React298.createElement(Stack198, { gap: "xs" }, /* @__PURE__ */ React298.createElement(
|
|
32911
33199
|
TextInput10,
|
|
32912
33200
|
{
|
|
32913
33201
|
placeholder: recipientType === "oracle" ? "Search oracles..." : "Search users...",
|
|
32914
|
-
leftSection: /* @__PURE__ */
|
|
32915
|
-
rightSection: searching ? /* @__PURE__ */
|
|
33202
|
+
leftSection: /* @__PURE__ */ React298.createElement(IconSearch8, { size: 16 }),
|
|
33203
|
+
rightSection: searching ? /* @__PURE__ */ React298.createElement(Loader55, { size: 14 }) : null,
|
|
32916
33204
|
value: searchQuery,
|
|
32917
33205
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
32918
33206
|
onKeyDown: (e) => e.key === "Enter" && handleSearch()
|
|
32919
33207
|
}
|
|
32920
|
-
), selectedRecipient ? /* @__PURE__ */
|
|
33208
|
+
), selectedRecipient ? /* @__PURE__ */ React298.createElement(Paper19, { p: "sm", withBorder: true }, /* @__PURE__ */ React298.createElement(Group110, { justify: "space-between" }, /* @__PURE__ */ React298.createElement(Group110, { gap: "xs" }, recipientType === "oracle" ? /* @__PURE__ */ React298.createElement(IconRobot5, { size: 16 }) : /* @__PURE__ */ React298.createElement(IconUser15, { size: 16 }), /* @__PURE__ */ React298.createElement(Text169, { size: "sm" }, selectedRecipient.displayName), /* @__PURE__ */ React298.createElement(Badge44, { size: "xs", variant: "light" }, selectedRecipient.did.slice(-12))), /* @__PURE__ */ React298.createElement(ActionIcon39, { size: "sm", variant: "subtle", onClick: () => setSelectedRecipient(null) }, /* @__PURE__ */ React298.createElement(IconX15, { size: 14 })))) : searchResults.length > 0 ? /* @__PURE__ */ React298.createElement(Paper19, { p: "xs", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React298.createElement(Stack198, { gap: 4 }, searchResults.map((result) => /* @__PURE__ */ React298.createElement(Button55, { key: result.did, variant: "subtle", size: "sm", justify: "flex-start", onClick: () => setSelectedRecipient(result) }, result.displayName)))) : null) : /* @__PURE__ */ React298.createElement(TextInput10, { label: "Recipient DID", placeholder: "did:ixo:...", value: manualDid, onChange: (e) => setManualDid(e.currentTarget.value) }), /* @__PURE__ */ React298.createElement(Divider30, null), /* @__PURE__ */ React298.createElement(Stack198, { gap: "xs" }, /* @__PURE__ */ React298.createElement(Text169, { size: "sm", fw: 500 }, "Permission Scope"), singleBlockMode && fixedBlock ? (
|
|
32921
33209
|
// Single block mode: show fixed block info
|
|
32922
|
-
/* @__PURE__ */
|
|
33210
|
+
/* @__PURE__ */ React298.createElement(Paper19, { p: "sm", withBorder: true }, /* @__PURE__ */ React298.createElement(Group110, { gap: "xs" }, /* @__PURE__ */ React298.createElement(Badge44, { variant: "light", color: "blue" }, fixedBlock.type), /* @__PURE__ */ React298.createElement(Text169, { size: "sm" }, fixedBlock.name || `Block ${fixedBlock.id.slice(-8)}`)), /* @__PURE__ */ React298.createElement(Text169, { size: "xs", c: "dimmed", mt: "xs" }, "Permission will be granted to execute this specific block."))
|
|
32923
33211
|
) : (
|
|
32924
33212
|
// Multi-block mode: show scope selection
|
|
32925
|
-
/* @__PURE__ */
|
|
33213
|
+
/* @__PURE__ */ React298.createElement(React298.Fragment, null, /* @__PURE__ */ React298.createElement(Radio6.Group, { value: scopeType, onChange: (v) => setScopeType(v) }, /* @__PURE__ */ React298.createElement(Stack198, { gap: "xs" }, /* @__PURE__ */ React298.createElement(Radio6, { value: "full", label: "Full flow access (can execute any block)" }), /* @__PURE__ */ React298.createElement(Radio6, { value: "blocks", label: "Specific blocks only" }))), scopeType === "blocks" && /* @__PURE__ */ React298.createElement(Paper19, { p: "sm", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React298.createElement(Stack198, { gap: "xs" }, blocks.map((block) => /* @__PURE__ */ React298.createElement(
|
|
32926
33214
|
Checkbox13,
|
|
32927
33215
|
{
|
|
32928
33216
|
key: block.id,
|
|
@@ -32937,7 +33225,7 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
32937
33225
|
}
|
|
32938
33226
|
}
|
|
32939
33227
|
)))))
|
|
32940
|
-
)), /* @__PURE__ */
|
|
33228
|
+
)), /* @__PURE__ */ React298.createElement(Divider30, null), /* @__PURE__ */ React298.createElement(Stack198, { gap: "xs" }, /* @__PURE__ */ React298.createElement(Checkbox13, { label: "Set expiration", checked: expirationEnabled, onChange: (e) => setExpirationEnabled(e.currentTarget.checked) }), expirationEnabled && /* @__PURE__ */ React298.createElement(NumberInput3, { label: "Expires in (days)", placeholder: "30", value: expirationDays, onChange: setExpirationDays, min: 1, max: 365 })), /* @__PURE__ */ React298.createElement(
|
|
32941
33229
|
Checkbox13,
|
|
32942
33230
|
{
|
|
32943
33231
|
label: "Recipient can grant permissions to others",
|
|
@@ -32945,7 +33233,7 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
32945
33233
|
checked: canDelegate,
|
|
32946
33234
|
onChange: (e) => setCanDelegate(e.currentTarget.checked)
|
|
32947
33235
|
}
|
|
32948
|
-
), /* @__PURE__ */
|
|
33236
|
+
), /* @__PURE__ */ React298.createElement(Divider30, null), /* @__PURE__ */ React298.createElement(TextInput10, { label: "Enter your PIN to sign this delegation", type: "password", placeholder: "PIN", value: pin, onChange: (e) => setPin(e.currentTarget.value) }), error && /* @__PURE__ */ React298.createElement(Alert55, { color: "red" }, error), /* @__PURE__ */ React298.createElement(Group110, { justify: "flex-end" }, /* @__PURE__ */ React298.createElement(Button55, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React298.createElement(Button55, { onClick: handleGrant, loading }, "Grant Permission")))
|
|
32949
33237
|
);
|
|
32950
33238
|
};
|
|
32951
33239
|
|
|
@@ -33062,4 +33350,4 @@ export {
|
|
|
33062
33350
|
getExtraSlashMenuItems,
|
|
33063
33351
|
useCreateIxoEditor
|
|
33064
33352
|
};
|
|
33065
|
-
//# sourceMappingURL=chunk-
|
|
33353
|
+
//# sourceMappingURL=chunk-TLYT3OAQ.mjs.map
|