@ixo/editor 2.40.0 → 2.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-JSVV5AQB.mjs → chunk-4TDDY3Q6.mjs} +643 -252
- package/dist/chunk-4TDDY3Q6.mjs.map +1 -0
- package/dist/{graphql-client-CQyRCD1j.d.ts → graphql-client-CFEZF6E1.d.ts} +52 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/mantine/index.d.ts +2 -2
- package/dist/mantine/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-JSVV5AQB.mjs.map +0 -1
|
@@ -1690,7 +1690,7 @@ var BlocknoteContext = createContext({
|
|
|
1690
1690
|
throw new Error("BlocknoteContext not initialized");
|
|
1691
1691
|
}
|
|
1692
1692
|
});
|
|
1693
|
-
var BlocknoteProvider = ({ children, editor, handlers, blockRequirements, editable, visualizationRenderer, getDynamicListData, dynamicListPanelRenderer, domainCardRenderer }) => {
|
|
1693
|
+
var BlocknoteProvider = ({ children, editor, handlers, blockRequirements, editable, visualizationRenderer, getDynamicListData, dynamicListPanelRenderer, domainCardRenderer, mapConfig }) => {
|
|
1694
1694
|
const [sharedProposals, setSharedProposals] = useState3({});
|
|
1695
1695
|
const sharedProposalsRef = useRef3({});
|
|
1696
1696
|
const [activeDrawerId, setActiveDrawerId] = useState3(null);
|
|
@@ -1790,7 +1790,8 @@ var BlocknoteProvider = ({ children, editor, handlers, blockRequirements, editab
|
|
|
1790
1790
|
visualizationRenderer,
|
|
1791
1791
|
getDynamicListData,
|
|
1792
1792
|
dynamicListPanelRenderer,
|
|
1793
|
-
domainCardRenderer
|
|
1793
|
+
domainCardRenderer,
|
|
1794
|
+
mapConfig
|
|
1794
1795
|
}
|
|
1795
1796
|
},
|
|
1796
1797
|
children
|
|
@@ -23681,6 +23682,360 @@ var FlowLinkBlockSpec = createReactBlockSpec20(
|
|
|
23681
23682
|
}
|
|
23682
23683
|
);
|
|
23683
23684
|
|
|
23685
|
+
// src/mantine/blocks/location/LocationBlockSpec.tsx
|
|
23686
|
+
import React238 from "react";
|
|
23687
|
+
import { createReactBlockSpec as createReactBlockSpec21 } from "@blocknote/react";
|
|
23688
|
+
|
|
23689
|
+
// src/mantine/blocks/location/LocationBlock.tsx
|
|
23690
|
+
import React237 from "react";
|
|
23691
|
+
|
|
23692
|
+
// src/mantine/blocks/location/template/TemplateView.tsx
|
|
23693
|
+
import React234, { useMemo as useMemo81 } from "react";
|
|
23694
|
+
import { Group as Group84, Stack as Stack152, Text as Text130 } from "@mantine/core";
|
|
23695
|
+
import { IconMapPin } from "@tabler/icons-react";
|
|
23696
|
+
|
|
23697
|
+
// src/mantine/blocks/location/template/TemplateConfig.tsx
|
|
23698
|
+
import React232, { useCallback as useCallback69 } from "react";
|
|
23699
|
+
import { IconSettings as IconSettings19 } from "@tabler/icons-react";
|
|
23700
|
+
|
|
23701
|
+
// src/mantine/blocks/location/template/GeneralTab.tsx
|
|
23702
|
+
import React231, { useEffect as useEffect70, useRef as useRef21, useState as useState86 } from "react";
|
|
23703
|
+
import { Box as Box44, Divider as Divider20, Stack as Stack151, Text as Text128 } from "@mantine/core";
|
|
23704
|
+
|
|
23705
|
+
// src/core/hooks/useUnlMap.ts
|
|
23706
|
+
import { useEffect as useEffect69, useState as useState85 } from "react";
|
|
23707
|
+
function useUnlMap() {
|
|
23708
|
+
const [status, setStatus] = useState85("loading");
|
|
23709
|
+
useEffect69(() => {
|
|
23710
|
+
if (typeof window === "undefined") {
|
|
23711
|
+
return;
|
|
23712
|
+
}
|
|
23713
|
+
if (window.UnlSdk) {
|
|
23714
|
+
setStatus("ready");
|
|
23715
|
+
return;
|
|
23716
|
+
}
|
|
23717
|
+
const loadScript = (src) => {
|
|
23718
|
+
return new Promise((resolve, reject) => {
|
|
23719
|
+
const existingScript = document.querySelector(`script[src="${src}"]`);
|
|
23720
|
+
if (existingScript) {
|
|
23721
|
+
return resolve(new Event("load"));
|
|
23722
|
+
}
|
|
23723
|
+
const script = document.createElement("script");
|
|
23724
|
+
script.src = src;
|
|
23725
|
+
script.async = true;
|
|
23726
|
+
script.addEventListener("load", resolve);
|
|
23727
|
+
script.addEventListener("error", reject);
|
|
23728
|
+
document.body.appendChild(script);
|
|
23729
|
+
});
|
|
23730
|
+
};
|
|
23731
|
+
const loadCSS = (href) => {
|
|
23732
|
+
return new Promise((resolve, reject) => {
|
|
23733
|
+
const existingLink = document.querySelector(`link[href="${href}"]`);
|
|
23734
|
+
if (existingLink) {
|
|
23735
|
+
return resolve(new Event("load"));
|
|
23736
|
+
}
|
|
23737
|
+
const link = document.createElement("link");
|
|
23738
|
+
link.href = href;
|
|
23739
|
+
link.rel = "stylesheet";
|
|
23740
|
+
link.addEventListener("load", resolve);
|
|
23741
|
+
link.addEventListener("error", reject);
|
|
23742
|
+
document.head.appendChild(link);
|
|
23743
|
+
});
|
|
23744
|
+
};
|
|
23745
|
+
Promise.all([
|
|
23746
|
+
loadScript("https://unpkg.com/unl-map-js@0.1.5/lib/unl-map-js.js"),
|
|
23747
|
+
loadCSS("https://unpkg.com/unl-map-js@0.1.5/lib/unl-map-js.css"),
|
|
23748
|
+
loadCSS("https://unpkg.com/maplibre-gl@2.1.9/dist/maplibre-gl.css")
|
|
23749
|
+
]).then(() => {
|
|
23750
|
+
setStatus("ready");
|
|
23751
|
+
}).catch(() => {
|
|
23752
|
+
setStatus("error");
|
|
23753
|
+
});
|
|
23754
|
+
return () => {
|
|
23755
|
+
};
|
|
23756
|
+
}, []);
|
|
23757
|
+
return {
|
|
23758
|
+
status,
|
|
23759
|
+
UnlSdk: status === "ready" && typeof window !== "undefined" ? window.UnlSdk : null
|
|
23760
|
+
};
|
|
23761
|
+
}
|
|
23762
|
+
|
|
23763
|
+
// src/mantine/blocks/location/template/GeneralTab.tsx
|
|
23764
|
+
var DEFAULT_CENTER = [0, 20];
|
|
23765
|
+
var DEFAULT_ZOOM = 2;
|
|
23766
|
+
var PLACED_ZOOM = 14;
|
|
23767
|
+
var GeneralTab17 = ({ title, description, latitude, longitude, onTitleChange, onDescriptionChange, onCoordinatesChange }) => {
|
|
23768
|
+
const [localTitle, setLocalTitle] = useState86(title);
|
|
23769
|
+
const [localDescription, setLocalDescription] = useState86(description);
|
|
23770
|
+
const [mapError, setMapError] = useState86(null);
|
|
23771
|
+
const { status, UnlSdk } = useUnlMap();
|
|
23772
|
+
const { mapConfig } = useBlocknoteContext();
|
|
23773
|
+
const markerRef = useRef21(null);
|
|
23774
|
+
const mapRef = useRef21(null);
|
|
23775
|
+
const containerRef = useRef21(null);
|
|
23776
|
+
useEffect70(() => {
|
|
23777
|
+
setLocalTitle(title);
|
|
23778
|
+
}, [title]);
|
|
23779
|
+
useEffect70(() => {
|
|
23780
|
+
setLocalDescription(description);
|
|
23781
|
+
}, [description]);
|
|
23782
|
+
useEffect70(() => {
|
|
23783
|
+
if (status !== "ready" || !UnlSdk || mapRef.current || !mapConfig || !containerRef.current) return;
|
|
23784
|
+
try {
|
|
23785
|
+
const hasCoords = latitude && longitude;
|
|
23786
|
+
const center = hasCoords ? [Number(longitude), Number(latitude)] : DEFAULT_CENTER;
|
|
23787
|
+
const zoom = hasCoords ? PLACED_ZOOM : DEFAULT_ZOOM;
|
|
23788
|
+
const map = new UnlSdk.Map({
|
|
23789
|
+
container: containerRef.current,
|
|
23790
|
+
apiKey: mapConfig.apiKey,
|
|
23791
|
+
vpmId: mapConfig.vpmId,
|
|
23792
|
+
center,
|
|
23793
|
+
zoom
|
|
23794
|
+
});
|
|
23795
|
+
mapRef.current = map;
|
|
23796
|
+
map.on("load", () => {
|
|
23797
|
+
if (hasCoords) {
|
|
23798
|
+
markerRef.current = new UnlSdk.Marker().setLngLat([Number(longitude), Number(latitude)]).addTo(map);
|
|
23799
|
+
}
|
|
23800
|
+
});
|
|
23801
|
+
map.on("click", (e) => {
|
|
23802
|
+
const { lng, lat } = e.lngLat;
|
|
23803
|
+
onCoordinatesChange(String(lat), String(lng));
|
|
23804
|
+
if (markerRef.current) {
|
|
23805
|
+
markerRef.current.setLngLat([lng, lat]);
|
|
23806
|
+
} else if (UnlSdk) {
|
|
23807
|
+
markerRef.current = new UnlSdk.Marker().setLngLat([lng, lat]).addTo(map);
|
|
23808
|
+
}
|
|
23809
|
+
});
|
|
23810
|
+
const ro = new ResizeObserver(() => {
|
|
23811
|
+
map.resize();
|
|
23812
|
+
});
|
|
23813
|
+
ro.observe(containerRef.current);
|
|
23814
|
+
return () => {
|
|
23815
|
+
ro.disconnect();
|
|
23816
|
+
mapRef.current = null;
|
|
23817
|
+
markerRef.current = null;
|
|
23818
|
+
};
|
|
23819
|
+
} catch (err) {
|
|
23820
|
+
console.error("Failed to initialize map:", err);
|
|
23821
|
+
setMapError("Failed to initialize map. WebGL may not be supported.");
|
|
23822
|
+
}
|
|
23823
|
+
return () => {
|
|
23824
|
+
mapRef.current = null;
|
|
23825
|
+
markerRef.current = null;
|
|
23826
|
+
};
|
|
23827
|
+
}, [status, UnlSdk]);
|
|
23828
|
+
return /* @__PURE__ */ React231.createElement(Stack151, { gap: "lg" }, /* @__PURE__ */ React231.createElement(Stack151, { gap: "xs" }, /* @__PURE__ */ React231.createElement(Text128, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React231.createElement(
|
|
23829
|
+
BaseTextInput,
|
|
23830
|
+
{
|
|
23831
|
+
placeholder: "e.g. Project Location",
|
|
23832
|
+
value: localTitle,
|
|
23833
|
+
onChange: (event) => {
|
|
23834
|
+
const v = event.currentTarget.value;
|
|
23835
|
+
setLocalTitle(v);
|
|
23836
|
+
onTitleChange(v);
|
|
23837
|
+
}
|
|
23838
|
+
}
|
|
23839
|
+
)), /* @__PURE__ */ React231.createElement(Stack151, { gap: "xs" }, /* @__PURE__ */ React231.createElement(Text128, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React231.createElement(
|
|
23840
|
+
BaseTextInput,
|
|
23841
|
+
{
|
|
23842
|
+
placeholder: "e.g. Main project site coordinates",
|
|
23843
|
+
value: localDescription,
|
|
23844
|
+
onChange: (event) => {
|
|
23845
|
+
const v = event.currentTarget.value;
|
|
23846
|
+
setLocalDescription(v);
|
|
23847
|
+
onDescriptionChange(v);
|
|
23848
|
+
}
|
|
23849
|
+
}
|
|
23850
|
+
)), /* @__PURE__ */ React231.createElement(Divider20, { variant: "dashed" }), /* @__PURE__ */ React231.createElement(Stack151, { gap: "xs" }, /* @__PURE__ */ React231.createElement(Text128, { size: "sm", fw: 600 }, "Location"), /* @__PURE__ */ React231.createElement(Text128, { size: "xs", c: "dimmed" }, "Click on the map to set the location."), mapError ? /* @__PURE__ */ React231.createElement(Text128, { size: "sm", c: "red" }, mapError) : /* @__PURE__ */ React231.createElement(Box44, { mx: "auto", w: "100%", miw: 280, h: 300, ref: containerRef, style: { borderRadius: 12 } })), /* @__PURE__ */ React231.createElement(Stack151, { gap: "xs" }, /* @__PURE__ */ React231.createElement(BaseTextInput, { label: "Latitude", value: latitude, readOnly: true, placeholder: "Not set" }), /* @__PURE__ */ React231.createElement(BaseTextInput, { label: "Longitude", value: longitude, readOnly: true, placeholder: "Not set" })));
|
|
23851
|
+
};
|
|
23852
|
+
|
|
23853
|
+
// src/mantine/blocks/location/template/TemplateConfig.tsx
|
|
23854
|
+
var TemplateConfig17 = ({ editor, block }) => {
|
|
23855
|
+
const { closePanel } = usePanelStore();
|
|
23856
|
+
const updateProp = useCallback69(
|
|
23857
|
+
(key, value) => {
|
|
23858
|
+
editor.updateBlock(block, { props: { ...block.props, [key]: value } });
|
|
23859
|
+
},
|
|
23860
|
+
[editor, block]
|
|
23861
|
+
);
|
|
23862
|
+
const updateProps = useCallback69(
|
|
23863
|
+
(updates) => {
|
|
23864
|
+
editor.updateBlock(block, { props: { ...block.props, ...updates } });
|
|
23865
|
+
},
|
|
23866
|
+
[editor, block]
|
|
23867
|
+
);
|
|
23868
|
+
const tabs = [
|
|
23869
|
+
{
|
|
23870
|
+
label: "General",
|
|
23871
|
+
value: "general",
|
|
23872
|
+
icon: icon(IconSettings19),
|
|
23873
|
+
content: /* @__PURE__ */ React232.createElement(
|
|
23874
|
+
GeneralTab17,
|
|
23875
|
+
{
|
|
23876
|
+
title: block.props.title || "",
|
|
23877
|
+
description: block.props.description || "",
|
|
23878
|
+
latitude: block.props.latitude || "",
|
|
23879
|
+
longitude: block.props.longitude || "",
|
|
23880
|
+
onTitleChange: (v) => updateProp("title", v),
|
|
23881
|
+
onDescriptionChange: (v) => updateProp("description", v),
|
|
23882
|
+
onCoordinatesChange: (lat, lng) => updateProps({ latitude: lat, longitude: lng })
|
|
23883
|
+
}
|
|
23884
|
+
)
|
|
23885
|
+
}
|
|
23886
|
+
];
|
|
23887
|
+
return /* @__PURE__ */ React232.createElement(BaseRightPanelLayout, { title: "Location Settings", onClose: closePanel, tabs, context: { editor, block } });
|
|
23888
|
+
};
|
|
23889
|
+
|
|
23890
|
+
// src/mantine/blocks/location/components/LocationMap.tsx
|
|
23891
|
+
import React233, { useEffect as useEffect71, useRef as useRef22, useState as useState87 } from "react";
|
|
23892
|
+
import { Box as Box45, Flex as Flex30, Loader as Loader34, Text as Text129 } from "@mantine/core";
|
|
23893
|
+
var UnlMap = ({ w = "100%", h = 200, latitude, longitude, zoom = 5, showMarker = true }) => {
|
|
23894
|
+
const [mapError, setMapError] = useState87(null);
|
|
23895
|
+
const { mapConfig } = useBlocknoteContext();
|
|
23896
|
+
const containerRef = useRef22(null);
|
|
23897
|
+
const mapRef = useRef22(null);
|
|
23898
|
+
const markerRef = useRef22(null);
|
|
23899
|
+
const { status, UnlSdk } = useUnlMap();
|
|
23900
|
+
useEffect71(() => {
|
|
23901
|
+
if (status !== "ready" || !UnlSdk || mapRef.current || !containerRef.current) return;
|
|
23902
|
+
let ro;
|
|
23903
|
+
try {
|
|
23904
|
+
const map = new UnlSdk.Map({
|
|
23905
|
+
container: containerRef.current,
|
|
23906
|
+
apiKey: mapConfig?.apiKey || "",
|
|
23907
|
+
vpmId: mapConfig?.vpmId || "",
|
|
23908
|
+
center: [Number(longitude), Number(latitude)],
|
|
23909
|
+
zoom
|
|
23910
|
+
});
|
|
23911
|
+
mapRef.current = map;
|
|
23912
|
+
if (showMarker) {
|
|
23913
|
+
markerRef.current = new UnlSdk.Marker().setLngLat([Number(longitude), Number(latitude)]).addTo(map);
|
|
23914
|
+
}
|
|
23915
|
+
ro = new ResizeObserver(() => {
|
|
23916
|
+
map.resize();
|
|
23917
|
+
});
|
|
23918
|
+
ro.observe(containerRef.current);
|
|
23919
|
+
} catch (err) {
|
|
23920
|
+
console.error("Failed to initialize map:", err);
|
|
23921
|
+
setMapError("Failed to initialize map");
|
|
23922
|
+
}
|
|
23923
|
+
return () => {
|
|
23924
|
+
ro?.disconnect();
|
|
23925
|
+
};
|
|
23926
|
+
}, [status, UnlSdk, mapConfig]);
|
|
23927
|
+
useEffect71(() => {
|
|
23928
|
+
if (!mapRef.current || !latitude || !longitude) return;
|
|
23929
|
+
const coords = [Number(longitude), Number(latitude)];
|
|
23930
|
+
mapRef.current.setCenter(coords);
|
|
23931
|
+
if (showMarker && markerRef.current) {
|
|
23932
|
+
markerRef.current.setLngLat(coords);
|
|
23933
|
+
}
|
|
23934
|
+
}, [latitude, longitude, showMarker]);
|
|
23935
|
+
if (status === "loading") {
|
|
23936
|
+
return /* @__PURE__ */ React233.createElement(
|
|
23937
|
+
Box45,
|
|
23938
|
+
{
|
|
23939
|
+
style: {
|
|
23940
|
+
borderRadius: 16,
|
|
23941
|
+
display: "flex",
|
|
23942
|
+
alignItems: "center",
|
|
23943
|
+
justifyContent: "center"
|
|
23944
|
+
},
|
|
23945
|
+
w,
|
|
23946
|
+
h
|
|
23947
|
+
},
|
|
23948
|
+
/* @__PURE__ */ React233.createElement(Loader34, null)
|
|
23949
|
+
);
|
|
23950
|
+
}
|
|
23951
|
+
if (status === "error" || mapError) {
|
|
23952
|
+
return /* @__PURE__ */ React233.createElement(
|
|
23953
|
+
Box45,
|
|
23954
|
+
{
|
|
23955
|
+
style: {
|
|
23956
|
+
borderRadius: 16,
|
|
23957
|
+
display: "flex",
|
|
23958
|
+
alignItems: "center",
|
|
23959
|
+
justifyContent: "center"
|
|
23960
|
+
},
|
|
23961
|
+
w,
|
|
23962
|
+
h
|
|
23963
|
+
},
|
|
23964
|
+
/* @__PURE__ */ React233.createElement(Text129, { size: "sm", c: "red" }, mapError || "Failed to load map")
|
|
23965
|
+
);
|
|
23966
|
+
}
|
|
23967
|
+
return /* @__PURE__ */ React233.createElement(Box45, { ref: containerRef, style: { borderRadius: 16 }, w, h });
|
|
23968
|
+
};
|
|
23969
|
+
function LocationMap(props) {
|
|
23970
|
+
if (props.latitude === void 0 || props.longitude === void 0)
|
|
23971
|
+
return /* @__PURE__ */ React233.createElement(Flex30, { w: "100%", h: 200, align: "center", justify: "center" }, /* @__PURE__ */ React233.createElement(Loader34, null));
|
|
23972
|
+
return /* @__PURE__ */ React233.createElement(UnlMap, { ...props });
|
|
23973
|
+
}
|
|
23974
|
+
|
|
23975
|
+
// src/mantine/blocks/location/template/TemplateView.tsx
|
|
23976
|
+
var LOCATION_TEMPLATE_PANEL_ID = "location-template-panel";
|
|
23977
|
+
var LocationTemplateView = ({ editor, block }) => {
|
|
23978
|
+
const panelId = `${LOCATION_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
23979
|
+
const panelContent = useMemo81(() => /* @__PURE__ */ React234.createElement(TemplateConfig17, { editor, block }), [editor, block]);
|
|
23980
|
+
const { open } = usePanel(panelId, panelContent);
|
|
23981
|
+
console.log("block.props:", block.props);
|
|
23982
|
+
const hasLocation = block.props.latitude && block.props.longitude;
|
|
23983
|
+
return /* @__PURE__ */ React234.createElement(BaseContainer, { onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React234.createElement(Stack152, { gap: "xs", justify: "center" }, /* @__PURE__ */ React234.createElement(Group84, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React234.createElement(IconMapPin, { color: "white", size: 26, stroke: 1.5 }), /* @__PURE__ */ React234.createElement(Stack152, { gap: 2 }, /* @__PURE__ */ React234.createElement(Text130, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Location"), block.props.description && /* @__PURE__ */ React234.createElement(Text130, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), hasLocation && /* @__PURE__ */ React234.createElement(LocationMap, { latitude: block.props.latitude, longitude: block.props.longitude, mapId: `location-template-map-${block.id}`, zoom: 14 })));
|
|
23984
|
+
};
|
|
23985
|
+
|
|
23986
|
+
// src/mantine/blocks/location/flow/FlowView.tsx
|
|
23987
|
+
import React236, { useMemo as useMemo82 } from "react";
|
|
23988
|
+
import { Center as Center13, Group as Group85, Stack as Stack153, Text as Text131 } from "@mantine/core";
|
|
23989
|
+
import { IconMapPin as IconMapPin2 } from "@tabler/icons-react";
|
|
23990
|
+
|
|
23991
|
+
// src/mantine/blocks/location/flow/FlowConfig.tsx
|
|
23992
|
+
import React235 from "react";
|
|
23993
|
+
var FlowConfig2 = ({ block }) => {
|
|
23994
|
+
const { closePanel } = usePanelStore();
|
|
23995
|
+
const hasLocation = block.props.latitude && block.props.longitude;
|
|
23996
|
+
return /* @__PURE__ */ React235.createElement(BaseRightPanelLayout, { title: block.props.title || "Location", onClose: closePanel, isTemplate: false }, hasLocation ? /* @__PURE__ */ React235.createElement(LocationMap, { latitude: block.props.latitude, longitude: block.props.longitude, h: 400, zoom: 14 }) : null);
|
|
23997
|
+
};
|
|
23998
|
+
|
|
23999
|
+
// src/mantine/blocks/location/flow/FlowView.tsx
|
|
24000
|
+
var LOCATION_FLOW_PANEL_ID = "location-flow-panel";
|
|
24001
|
+
var LocationFlowView = ({ editor, block }) => {
|
|
24002
|
+
const panelId = `${LOCATION_FLOW_PANEL_ID}-${block.id}`;
|
|
24003
|
+
const panelContent = useMemo82(() => /* @__PURE__ */ React236.createElement(FlowConfig2, { editor, block }), [editor, block]);
|
|
24004
|
+
const { open } = usePanel(panelId, panelContent);
|
|
24005
|
+
const hasLocation = block.props.latitude && block.props.longitude;
|
|
24006
|
+
return /* @__PURE__ */ React236.createElement(BaseContainer, { onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React236.createElement(Stack153, { gap: "xs", justify: "center" }, /* @__PURE__ */ React236.createElement(Group85, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React236.createElement(IconMapPin2, { color: "white", size: 26, stroke: 1.5 }), /* @__PURE__ */ React236.createElement(Stack153, { gap: 2 }, /* @__PURE__ */ React236.createElement(Text131, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Location"), block.props.description && /* @__PURE__ */ React236.createElement(Text131, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), hasLocation ? /* @__PURE__ */ React236.createElement(LocationMap, { latitude: block.props.latitude, longitude: block.props.longitude, mapId: `location-flow-map-${block.id}`, zoom: 14 }) : /* @__PURE__ */ React236.createElement(Center13, { py: "md" }, /* @__PURE__ */ React236.createElement(Text131, { size: "sm", c: "dimmed" }, "Location not configured"))));
|
|
24007
|
+
};
|
|
24008
|
+
|
|
24009
|
+
// src/mantine/blocks/location/LocationBlock.tsx
|
|
24010
|
+
function LocationBlock({ editor, block }) {
|
|
24011
|
+
const { docType } = useBlocknoteContext();
|
|
24012
|
+
if (docType === "template") {
|
|
24013
|
+
return /* @__PURE__ */ React237.createElement(LocationTemplateView, { editor, block });
|
|
24014
|
+
}
|
|
24015
|
+
return /* @__PURE__ */ React237.createElement(LocationFlowView, { editor, block });
|
|
24016
|
+
}
|
|
24017
|
+
|
|
24018
|
+
// src/mantine/blocks/location/LocationBlockSpec.tsx
|
|
24019
|
+
var LocationBlockSpec = createReactBlockSpec21(
|
|
24020
|
+
{
|
|
24021
|
+
type: "location",
|
|
24022
|
+
propSchema: {
|
|
24023
|
+
title: { default: "" },
|
|
24024
|
+
description: { default: "" },
|
|
24025
|
+
latitude: { default: "" },
|
|
24026
|
+
longitude: { default: "" },
|
|
24027
|
+
skill: { default: "" }
|
|
24028
|
+
},
|
|
24029
|
+
content: "none"
|
|
24030
|
+
},
|
|
24031
|
+
{
|
|
24032
|
+
render: (props) => {
|
|
24033
|
+
const ixoProps = props;
|
|
24034
|
+
return /* @__PURE__ */ React238.createElement(LocationBlock, { ...ixoProps });
|
|
24035
|
+
}
|
|
24036
|
+
}
|
|
24037
|
+
);
|
|
24038
|
+
|
|
23684
24039
|
// src/mantine/blocks/registry/blockRegistry.ts
|
|
23685
24040
|
var BlockRegistry = class {
|
|
23686
24041
|
constructor() {
|
|
@@ -23850,12 +24205,23 @@ blockRegistry.register({
|
|
|
23850
24205
|
lastSubmission: ""
|
|
23851
24206
|
}
|
|
23852
24207
|
});
|
|
24208
|
+
blockRegistry.register({
|
|
24209
|
+
type: "location",
|
|
24210
|
+
propSchema: {
|
|
24211
|
+
title: "",
|
|
24212
|
+
description: "",
|
|
24213
|
+
latitude: "",
|
|
24214
|
+
longitude: ""
|
|
24215
|
+
},
|
|
24216
|
+
validDependencies: [],
|
|
24217
|
+
defaultProps: {}
|
|
24218
|
+
});
|
|
23853
24219
|
|
|
23854
24220
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
23855
|
-
import { useMemo as
|
|
24221
|
+
import { useMemo as useMemo83, useEffect as useEffect72, useState as useState88, useCallback as useCallback70 } from "react";
|
|
23856
24222
|
|
|
23857
24223
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
23858
|
-
import { useMemo as
|
|
24224
|
+
import { useMemo as useMemo84 } from "react";
|
|
23859
24225
|
|
|
23860
24226
|
// src/mantine/blocks/index.ts
|
|
23861
24227
|
var blockSpecs = {
|
|
@@ -23878,7 +24244,8 @@ var blockSpecs = {
|
|
|
23878
24244
|
domainCreatorSign: DomainCreatorSignBlockSpec,
|
|
23879
24245
|
domainCardViewer: DomainCardViewerBlockSpec,
|
|
23880
24246
|
governanceGroup: GovernanceGroupBlockSpec,
|
|
23881
|
-
flowLink: FlowLinkBlockSpec
|
|
24247
|
+
flowLink: FlowLinkBlockSpec,
|
|
24248
|
+
location: LocationBlockSpec
|
|
23882
24249
|
};
|
|
23883
24250
|
var getExtraSlashMenuItems = (editor) => {
|
|
23884
24251
|
const slashMenuList = [
|
|
@@ -24342,6 +24709,28 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
24342
24709
|
aliases: ["flow-link", "link", "navigate", "redirect"],
|
|
24343
24710
|
group: "Flows",
|
|
24344
24711
|
subtext: "Link to other flow documents"
|
|
24712
|
+
},
|
|
24713
|
+
{
|
|
24714
|
+
title: "Location",
|
|
24715
|
+
onItemClick: () => {
|
|
24716
|
+
editor.insertBlocks(
|
|
24717
|
+
[
|
|
24718
|
+
{
|
|
24719
|
+
type: "location",
|
|
24720
|
+
props: {
|
|
24721
|
+
title: "",
|
|
24722
|
+
latitude: "",
|
|
24723
|
+
longitude: ""
|
|
24724
|
+
}
|
|
24725
|
+
}
|
|
24726
|
+
],
|
|
24727
|
+
editor.getTextCursorPosition().block,
|
|
24728
|
+
"after"
|
|
24729
|
+
);
|
|
24730
|
+
},
|
|
24731
|
+
aliases: ["location", "map", "gps", "coordinates"],
|
|
24732
|
+
group: "Basics",
|
|
24733
|
+
subtext: "Set a location on a map"
|
|
24345
24734
|
}
|
|
24346
24735
|
];
|
|
24347
24736
|
const yRoot = editor?._yRoot;
|
|
@@ -24420,15 +24809,15 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
24420
24809
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
24421
24810
|
|
|
24422
24811
|
// src/core/hooks/useMatrixProvider.ts
|
|
24423
|
-
import { useEffect as
|
|
24812
|
+
import { useEffect as useEffect73, useState as useState89, useRef as useRef23, useCallback as useCallback71, useMemo as useMemo85 } from "react";
|
|
24424
24813
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
24425
24814
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
24426
|
-
const [matrixProvider, setProvider] =
|
|
24427
|
-
const [status, setStatus] =
|
|
24428
|
-
const isMountedRef =
|
|
24429
|
-
const providerRef =
|
|
24430
|
-
const retryTimeoutRef =
|
|
24431
|
-
const providerOptions =
|
|
24815
|
+
const [matrixProvider, setProvider] = useState89(null);
|
|
24816
|
+
const [status, setStatus] = useState89("disconnected");
|
|
24817
|
+
const isMountedRef = useRef23(true);
|
|
24818
|
+
const providerRef = useRef23(null);
|
|
24819
|
+
const retryTimeoutRef = useRef23(null);
|
|
24820
|
+
const providerOptions = useMemo85(
|
|
24432
24821
|
() => ({
|
|
24433
24822
|
translator: {
|
|
24434
24823
|
updateEventType: "matrix-crdt.doc_update",
|
|
@@ -24441,22 +24830,22 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
24441
24830
|
}),
|
|
24442
24831
|
[]
|
|
24443
24832
|
);
|
|
24444
|
-
const handleDocumentAvailable =
|
|
24833
|
+
const handleDocumentAvailable = useCallback71(() => {
|
|
24445
24834
|
if (isMountedRef.current) {
|
|
24446
24835
|
setStatus("connected");
|
|
24447
24836
|
}
|
|
24448
24837
|
}, []);
|
|
24449
|
-
const handleDocumentUnavailable =
|
|
24838
|
+
const handleDocumentUnavailable = useCallback71(() => {
|
|
24450
24839
|
if (isMountedRef.current) {
|
|
24451
24840
|
setStatus("failed");
|
|
24452
24841
|
}
|
|
24453
24842
|
}, []);
|
|
24454
|
-
const handleCanWriteChanged =
|
|
24843
|
+
const handleCanWriteChanged = useCallback71(() => {
|
|
24455
24844
|
if (isMountedRef.current && providerRef.current) {
|
|
24456
24845
|
setStatus(providerRef.current.canWrite ? "connected" : "failed");
|
|
24457
24846
|
}
|
|
24458
24847
|
}, []);
|
|
24459
|
-
const initProvider =
|
|
24848
|
+
const initProvider = useCallback71(async () => {
|
|
24460
24849
|
if (!isMountedRef.current) return;
|
|
24461
24850
|
if (retryTimeoutRef.current) {
|
|
24462
24851
|
clearTimeout(retryTimeoutRef.current);
|
|
@@ -24489,7 +24878,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
24489
24878
|
}
|
|
24490
24879
|
}
|
|
24491
24880
|
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
24492
|
-
|
|
24881
|
+
useEffect73(() => {
|
|
24493
24882
|
isMountedRef.current = true;
|
|
24494
24883
|
initProvider();
|
|
24495
24884
|
return () => {
|
|
@@ -24506,7 +24895,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
24506
24895
|
setStatus("disconnected");
|
|
24507
24896
|
};
|
|
24508
24897
|
}, [initProvider]);
|
|
24509
|
-
|
|
24898
|
+
useEffect73(() => {
|
|
24510
24899
|
return () => {
|
|
24511
24900
|
isMountedRef.current = false;
|
|
24512
24901
|
};
|
|
@@ -24515,17 +24904,17 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
24515
24904
|
}
|
|
24516
24905
|
|
|
24517
24906
|
// src/mantine/hooks/useCollaborativeYDoc.ts
|
|
24518
|
-
import { useMemo as
|
|
24907
|
+
import { useMemo as useMemo86 } from "react";
|
|
24519
24908
|
import * as Y from "yjs";
|
|
24520
24909
|
function useCollaborativeYDoc(_options) {
|
|
24521
|
-
return
|
|
24910
|
+
return useMemo86(() => {
|
|
24522
24911
|
const doc = new Y.Doc();
|
|
24523
24912
|
return doc;
|
|
24524
24913
|
}, []);
|
|
24525
24914
|
}
|
|
24526
24915
|
|
|
24527
24916
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
24528
|
-
import { useMemo as
|
|
24917
|
+
import { useMemo as useMemo87, useEffect as useEffect74, useState as useState90 } from "react";
|
|
24529
24918
|
|
|
24530
24919
|
// src/core/lib/matrixMetadata.ts
|
|
24531
24920
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -24694,7 +25083,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24694
25083
|
matrixClient,
|
|
24695
25084
|
permissions = { write: false }
|
|
24696
25085
|
} = options || {};
|
|
24697
|
-
const memoizedUser =
|
|
25086
|
+
const memoizedUser = useMemo87(
|
|
24698
25087
|
() => ({
|
|
24699
25088
|
id: user?.id || "",
|
|
24700
25089
|
name: user?.name || "",
|
|
@@ -24709,13 +25098,13 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24709
25098
|
matrixClient,
|
|
24710
25099
|
roomId: options.roomId
|
|
24711
25100
|
});
|
|
24712
|
-
const metadataManager =
|
|
24713
|
-
|
|
25101
|
+
const metadataManager = useMemo87(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
25102
|
+
useEffect74(() => {
|
|
24714
25103
|
return () => {
|
|
24715
25104
|
metadataManager.dispose();
|
|
24716
25105
|
};
|
|
24717
25106
|
}, [metadataManager]);
|
|
24718
|
-
const defaultUploadFile =
|
|
25107
|
+
const defaultUploadFile = useMemo87(
|
|
24719
25108
|
() => uploadFile || (async (file) => {
|
|
24720
25109
|
return new Promise((resolve, reject) => {
|
|
24721
25110
|
const reader = new FileReader();
|
|
@@ -24729,7 +25118,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24729
25118
|
}),
|
|
24730
25119
|
[uploadFile]
|
|
24731
25120
|
);
|
|
24732
|
-
const schema =
|
|
25121
|
+
const schema = useMemo87(
|
|
24733
25122
|
() => BlockNoteSchema2.create({
|
|
24734
25123
|
blockSpecs: {
|
|
24735
25124
|
...defaultBlockSpecs2,
|
|
@@ -24744,16 +25133,16 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24744
25133
|
}),
|
|
24745
25134
|
[]
|
|
24746
25135
|
);
|
|
24747
|
-
const root =
|
|
24748
|
-
const documentFragment =
|
|
24749
|
-
const flowArray =
|
|
24750
|
-
const runtimeMap =
|
|
24751
|
-
const delegationsMap =
|
|
24752
|
-
const invocationsMap =
|
|
24753
|
-
const ucanDelegationStore =
|
|
24754
|
-
const invocationStore =
|
|
24755
|
-
const userFragment =
|
|
24756
|
-
const collaborationConfig =
|
|
25136
|
+
const root = useMemo87(() => yDoc.getMap("root"), [yDoc]);
|
|
25137
|
+
const documentFragment = useMemo87(() => yDoc.getXmlFragment("document"), [yDoc]);
|
|
25138
|
+
const flowArray = useMemo87(() => yDoc.getArray("flow"), [yDoc]);
|
|
25139
|
+
const runtimeMap = useMemo87(() => yDoc.getMap("runtime"), [yDoc]);
|
|
25140
|
+
const delegationsMap = useMemo87(() => yDoc.getMap("delegations"), [yDoc]);
|
|
25141
|
+
const invocationsMap = useMemo87(() => yDoc.getMap("invocations"), [yDoc]);
|
|
25142
|
+
const ucanDelegationStore = useMemo87(() => createUcanDelegationStore(delegationsMap), [delegationsMap]);
|
|
25143
|
+
const invocationStore = useMemo87(() => createInvocationStore(invocationsMap), [invocationsMap]);
|
|
25144
|
+
const userFragment = useMemo87(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
25145
|
+
const collaborationConfig = useMemo87(
|
|
24757
25146
|
() => ({
|
|
24758
25147
|
provider: matrixProvider,
|
|
24759
25148
|
fragment: documentFragment,
|
|
@@ -24765,7 +25154,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24765
25154
|
}),
|
|
24766
25155
|
[matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
|
|
24767
25156
|
);
|
|
24768
|
-
const ixoConfig =
|
|
25157
|
+
const ixoConfig = useMemo87(
|
|
24769
25158
|
() => ({
|
|
24770
25159
|
theme,
|
|
24771
25160
|
editable,
|
|
@@ -24784,7 +25173,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24784
25173
|
uploadFile: defaultUploadFile,
|
|
24785
25174
|
collaboration: collaborationConfig
|
|
24786
25175
|
});
|
|
24787
|
-
const titleText =
|
|
25176
|
+
const titleText = useMemo87(() => yDoc.getText("title"), [yDoc]);
|
|
24788
25177
|
let ixoEditor;
|
|
24789
25178
|
if (editor) {
|
|
24790
25179
|
ixoEditor = editor;
|
|
@@ -24962,12 +25351,12 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24962
25351
|
return void 0;
|
|
24963
25352
|
};
|
|
24964
25353
|
}
|
|
24965
|
-
|
|
25354
|
+
useEffect74(() => {
|
|
24966
25355
|
if (ixoEditor) {
|
|
24967
25356
|
ixoEditor.isEditable = editable;
|
|
24968
25357
|
}
|
|
24969
25358
|
}, [ixoEditor, editable]);
|
|
24970
|
-
|
|
25359
|
+
useEffect74(() => {
|
|
24971
25360
|
if (connectionStatus !== "connected") {
|
|
24972
25361
|
return;
|
|
24973
25362
|
}
|
|
@@ -24989,9 +25378,9 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24989
25378
|
titleText.insert(0, options.title);
|
|
24990
25379
|
}
|
|
24991
25380
|
}, [connectionStatus, root, titleText, permissions.write, options.docId, options.title, memoizedUser.id]);
|
|
24992
|
-
const [connectedUsers, setConnectedUsers] =
|
|
25381
|
+
const [connectedUsers, setConnectedUsers] = useState90([]);
|
|
24993
25382
|
const webrtcProvider = matrixProvider?.webrtcProvider;
|
|
24994
|
-
|
|
25383
|
+
useEffect74(() => {
|
|
24995
25384
|
if (!matrixProvider?.awarenessInstance || !webrtcProvider || connectionStatus !== "connected") {
|
|
24996
25385
|
return;
|
|
24997
25386
|
}
|
|
@@ -25010,7 +25399,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
25010
25399
|
awareness.off("change", updateUsers);
|
|
25011
25400
|
};
|
|
25012
25401
|
}, [matrixProvider, webrtcProvider, connectionStatus]);
|
|
25013
|
-
|
|
25402
|
+
useEffect74(() => {
|
|
25014
25403
|
if (!matrixProvider?.awarenessInstance || !webrtcProvider || connectionStatus !== "connected") {
|
|
25015
25404
|
return;
|
|
25016
25405
|
}
|
|
@@ -25048,15 +25437,15 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
25048
25437
|
}
|
|
25049
25438
|
|
|
25050
25439
|
// src/mantine/IxoEditor.tsx
|
|
25051
|
-
import
|
|
25440
|
+
import React246, { useState as useState95, useEffect as useEffect79, useCallback as useCallback73 } from "react";
|
|
25052
25441
|
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
25053
25442
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
25054
25443
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
25055
25444
|
import { MantineProvider } from "@mantine/core";
|
|
25056
25445
|
|
|
25057
25446
|
// src/mantine/components/PanelContent.tsx
|
|
25058
|
-
import
|
|
25059
|
-
import { Box as
|
|
25447
|
+
import React239 from "react";
|
|
25448
|
+
import { Box as Box46 } from "@mantine/core";
|
|
25060
25449
|
var panelStyles = {
|
|
25061
25450
|
light: {
|
|
25062
25451
|
backgroundColor: "#ffffff",
|
|
@@ -25085,8 +25474,8 @@ function PanelContent({ theme }) {
|
|
|
25085
25474
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
25086
25475
|
const isOpen = activePanel !== null;
|
|
25087
25476
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
25088
|
-
return /* @__PURE__ */
|
|
25089
|
-
|
|
25477
|
+
return /* @__PURE__ */ React239.createElement(
|
|
25478
|
+
Box46,
|
|
25090
25479
|
{
|
|
25091
25480
|
pos: "sticky",
|
|
25092
25481
|
right: 0,
|
|
@@ -25105,8 +25494,8 @@ function PanelContent({ theme }) {
|
|
|
25105
25494
|
}
|
|
25106
25495
|
|
|
25107
25496
|
// src/mantine/components/CoverImage.tsx
|
|
25108
|
-
import
|
|
25109
|
-
import { Box as
|
|
25497
|
+
import React243, { useState as useState92, useRef as useRef24, useEffect as useEffect76 } from "react";
|
|
25498
|
+
import { Box as Box49, Group as Group87 } from "@mantine/core";
|
|
25110
25499
|
|
|
25111
25500
|
// src/core/lib/imageTransform.ts
|
|
25112
25501
|
var CLOUDFLARE_CDN_BASE = "https://www.ixo.earth/cdn-cgi/image";
|
|
@@ -25239,9 +25628,9 @@ function transformIconImage(sourceUrl, size = "default", customOptions) {
|
|
|
25239
25628
|
}
|
|
25240
25629
|
|
|
25241
25630
|
// src/mantine/components/Base/CoverImageButton.tsx
|
|
25242
|
-
import
|
|
25631
|
+
import React240, { forwardRef } from "react";
|
|
25243
25632
|
import { Button as Button38 } from "@mantine/core";
|
|
25244
|
-
var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style, ...props }, ref) => /* @__PURE__ */
|
|
25633
|
+
var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style, ...props }, ref) => /* @__PURE__ */ React240.createElement(
|
|
25245
25634
|
Button38,
|
|
25246
25635
|
{
|
|
25247
25636
|
ref,
|
|
@@ -25264,8 +25653,8 @@ var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style,
|
|
|
25264
25653
|
CoverImageButton.displayName = "CoverImageButton";
|
|
25265
25654
|
|
|
25266
25655
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
25267
|
-
import
|
|
25268
|
-
import { TextInput as TextInput7, Tabs as Tabs4, Box as
|
|
25656
|
+
import React241, { useState as useState91, useMemo as useMemo88, useEffect as useEffect75 } from "react";
|
|
25657
|
+
import { TextInput as TextInput7, Tabs as Tabs4, Box as Box47, Stack as Stack154, UnstyledButton as UnstyledButton2, Text as Text132, Center as Center14, ScrollArea as ScrollArea8, Group as Group86, Popover as Popover4 } from "@mantine/core";
|
|
25269
25658
|
import * as TablerIcons from "@tabler/icons-react";
|
|
25270
25659
|
import { IconSearch as IconSearch6, IconX as IconX13, IconChevronLeft, IconChevronRight as IconChevronRight11 } from "@tabler/icons-react";
|
|
25271
25660
|
|
|
@@ -25297,28 +25686,28 @@ var localStorageService = {
|
|
|
25297
25686
|
var iconsKey = "editor_recent_icons";
|
|
25298
25687
|
var ICONS_PER_PAGE = 500;
|
|
25299
25688
|
function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children, currentIcon }) {
|
|
25300
|
-
const [searchQuery, setSearchQuery] =
|
|
25301
|
-
const [activeTab, setActiveTab] =
|
|
25302
|
-
const [currentPage, setCurrentPage] =
|
|
25303
|
-
const allIcons =
|
|
25689
|
+
const [searchQuery, setSearchQuery] = useState91("");
|
|
25690
|
+
const [activeTab, setActiveTab] = useState91("icons");
|
|
25691
|
+
const [currentPage, setCurrentPage] = useState91(1);
|
|
25692
|
+
const allIcons = useMemo88(() => {
|
|
25304
25693
|
const iconEntries = Object.entries(TablerIcons).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
25305
25694
|
return iconEntries;
|
|
25306
25695
|
}, []);
|
|
25307
|
-
const filteredIcons =
|
|
25696
|
+
const filteredIcons = useMemo88(() => {
|
|
25308
25697
|
if (!searchQuery) return allIcons;
|
|
25309
25698
|
const query = searchQuery.toLowerCase();
|
|
25310
25699
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
25311
25700
|
}, [allIcons, searchQuery]);
|
|
25312
|
-
|
|
25701
|
+
useEffect75(() => {
|
|
25313
25702
|
setCurrentPage(1);
|
|
25314
25703
|
}, [searchQuery]);
|
|
25315
|
-
const paginatedIcons =
|
|
25704
|
+
const paginatedIcons = useMemo88(() => {
|
|
25316
25705
|
const startIndex = (currentPage - 1) * ICONS_PER_PAGE;
|
|
25317
25706
|
const endIndex = startIndex + ICONS_PER_PAGE;
|
|
25318
25707
|
return filteredIcons.slice(startIndex, endIndex);
|
|
25319
25708
|
}, [filteredIcons, currentPage]);
|
|
25320
25709
|
const totalPages = Math.ceil(filteredIcons.length / ICONS_PER_PAGE);
|
|
25321
|
-
const recentIcons =
|
|
25710
|
+
const recentIcons = useMemo88(() => {
|
|
25322
25711
|
const recentIconNames = localStorageService.get(iconsKey);
|
|
25323
25712
|
if (!recentIconNames || recentIconNames.length === 0) return [];
|
|
25324
25713
|
return recentIconNames.slice(0, 24).map((iconName) => allIcons.find(([name]) => name === iconName)).filter((entry) => entry !== void 0);
|
|
@@ -25333,10 +25722,10 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
25333
25722
|
};
|
|
25334
25723
|
const renderIconGrid = (icons) => {
|
|
25335
25724
|
if (icons.length === 0) {
|
|
25336
|
-
return /* @__PURE__ */
|
|
25725
|
+
return /* @__PURE__ */ React241.createElement(Center14, { py: "xl" }, /* @__PURE__ */ React241.createElement(Text132, { c: "dimmed", size: "sm" }, "No icons found"));
|
|
25337
25726
|
}
|
|
25338
|
-
return /* @__PURE__ */
|
|
25339
|
-
|
|
25727
|
+
return /* @__PURE__ */ React241.createElement(
|
|
25728
|
+
Box47,
|
|
25340
25729
|
{
|
|
25341
25730
|
style: {
|
|
25342
25731
|
display: "grid",
|
|
@@ -25347,7 +25736,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
25347
25736
|
},
|
|
25348
25737
|
icons.map(([name, IconComponent]) => {
|
|
25349
25738
|
const isSelected = currentIcon === name.replace("Icon", "").replace(/([A-Z])/g, "-$1").toLowerCase().slice(1);
|
|
25350
|
-
return /* @__PURE__ */
|
|
25739
|
+
return /* @__PURE__ */ React241.createElement(
|
|
25351
25740
|
UnstyledButton2,
|
|
25352
25741
|
{
|
|
25353
25742
|
key: name,
|
|
@@ -25373,12 +25762,12 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
25373
25762
|
}
|
|
25374
25763
|
}
|
|
25375
25764
|
},
|
|
25376
|
-
/* @__PURE__ */
|
|
25765
|
+
/* @__PURE__ */ React241.createElement(IconComponent, { color: "white", size: 24, stroke: 1.5 })
|
|
25377
25766
|
);
|
|
25378
25767
|
})
|
|
25379
25768
|
);
|
|
25380
25769
|
};
|
|
25381
|
-
return /* @__PURE__ */
|
|
25770
|
+
return /* @__PURE__ */ React241.createElement(Popover4, { opened, onClose, position: "right", width: 500, shadow: "xl" }, /* @__PURE__ */ React241.createElement(Popover4.Target, null, children), /* @__PURE__ */ React241.createElement(
|
|
25382
25771
|
Popover4.Dropdown,
|
|
25383
25772
|
{
|
|
25384
25773
|
style: {
|
|
@@ -25388,15 +25777,15 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
25388
25777
|
},
|
|
25389
25778
|
p: 0
|
|
25390
25779
|
},
|
|
25391
|
-
/* @__PURE__ */
|
|
25780
|
+
/* @__PURE__ */ React241.createElement(Stack154, { gap: "md", p: "md" }, /* @__PURE__ */ React241.createElement(Tabs4, { value: activeTab, onChange: setActiveTab, variant: "pills" }, /* @__PURE__ */ React241.createElement(Tabs4.List, null, /* @__PURE__ */ React241.createElement(Tabs4.Tab, { value: "icons" }, "Icons"), /* @__PURE__ */ React241.createElement(Tabs4.Tab, { value: "upload" }, "Upload")), /* @__PURE__ */ React241.createElement(Tabs4.Panel, { value: "icons", pt: "md" }, /* @__PURE__ */ React241.createElement(
|
|
25392
25781
|
TextInput7,
|
|
25393
25782
|
{
|
|
25394
25783
|
mb: "md",
|
|
25395
25784
|
placeholder: "Filter",
|
|
25396
|
-
leftSection: /* @__PURE__ */
|
|
25785
|
+
leftSection: /* @__PURE__ */ React241.createElement(IconSearch6, { size: 18 }),
|
|
25397
25786
|
value: searchQuery,
|
|
25398
25787
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
25399
|
-
rightSection: searchQuery && /* @__PURE__ */
|
|
25788
|
+
rightSection: searchQuery && /* @__PURE__ */ React241.createElement(UnstyledButton2, { onClick: () => setSearchQuery("") }, /* @__PURE__ */ React241.createElement(IconX13, { size: 18 })),
|
|
25400
25789
|
style: { flex: 1 },
|
|
25401
25790
|
styles: {
|
|
25402
25791
|
input: {
|
|
@@ -25406,26 +25795,26 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
25406
25795
|
}
|
|
25407
25796
|
}
|
|
25408
25797
|
}
|
|
25409
|
-
), !searchQuery && /* @__PURE__ */
|
|
25798
|
+
), !searchQuery && /* @__PURE__ */ React241.createElement(Box47, { mb: "md" }, /* @__PURE__ */ React241.createElement(Text132, { size: "sm", fw: 500, mb: "xs", px: "xs" }, "Recent"), /* @__PURE__ */ React241.createElement(ScrollArea8.Autosize, { scrollbarSize: 0, mah: 60 }, renderIconGrid(recentIcons))), /* @__PURE__ */ React241.createElement(Box47, null, /* @__PURE__ */ React241.createElement(Group86, { justify: "space-between", mb: "xs", px: "xs" }, /* @__PURE__ */ React241.createElement(Text132, { size: "sm", fw: 500 }, searchQuery ? "Results" : "Icons"), totalPages > 1 && /* @__PURE__ */ React241.createElement(Group86, { gap: "xs" }, /* @__PURE__ */ React241.createElement(Text132, { size: "xs", c: "dimmed" }, "Page ", currentPage, " of ", totalPages, " (", filteredIcons.length, " total)"), /* @__PURE__ */ React241.createElement(BaseButton, { size: "xs", onClick: () => setCurrentPage((p) => Math.max(1, p - 1)), disabled: currentPage === 1, leftSection: /* @__PURE__ */ React241.createElement(IconChevronLeft, { size: 14 }) }, "Prev"), /* @__PURE__ */ React241.createElement(
|
|
25410
25799
|
BaseButton,
|
|
25411
25800
|
{
|
|
25412
25801
|
size: "xs",
|
|
25413
25802
|
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
25414
25803
|
disabled: currentPage === totalPages,
|
|
25415
|
-
leftSection: /* @__PURE__ */
|
|
25804
|
+
leftSection: /* @__PURE__ */ React241.createElement(IconChevronRight11, { size: 14 })
|
|
25416
25805
|
},
|
|
25417
25806
|
"Next"
|
|
25418
|
-
))), /* @__PURE__ */
|
|
25807
|
+
))), /* @__PURE__ */ React241.createElement(ScrollArea8.Autosize, { scrollbarSize: 0, mah: 200 }, renderIconGrid(paginatedIcons)))), /* @__PURE__ */ React241.createElement(Tabs4.Panel, { value: "upload", pt: "md" }, /* @__PURE__ */ React241.createElement(Center14, { py: "xl" }, /* @__PURE__ */ React241.createElement(Stack154, { align: "center", gap: "md" }, /* @__PURE__ */ React241.createElement(Text132, { size: "sm", c: "dimmed", ta: "center" }, "Upload a custom icon image", /* @__PURE__ */ React241.createElement("br", null), "(PNG, JPG, SVG)"), /* @__PURE__ */ React241.createElement(CoverImageButton, { onClick: onUploadClick }, "Choose File"))))))
|
|
25419
25808
|
));
|
|
25420
25809
|
}
|
|
25421
25810
|
|
|
25422
25811
|
// src/mantine/components/Base/PageIcon.tsx
|
|
25423
|
-
import
|
|
25424
|
-
import { Center as
|
|
25812
|
+
import React242, { useMemo as useMemo89 } from "react";
|
|
25813
|
+
import { Center as Center15, Box as Box48 } from "@mantine/core";
|
|
25425
25814
|
import * as TablerIcons2 from "@tabler/icons-react";
|
|
25426
25815
|
function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
25427
25816
|
const isIconName = src && !src.startsWith("http");
|
|
25428
|
-
const IconComponent =
|
|
25817
|
+
const IconComponent = useMemo89(() => {
|
|
25429
25818
|
if (!isIconName || !src) return null;
|
|
25430
25819
|
const iconComponent = TablerIcons2[src];
|
|
25431
25820
|
if (iconComponent) {
|
|
@@ -25433,10 +25822,10 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
25433
25822
|
}
|
|
25434
25823
|
return null;
|
|
25435
25824
|
}, [isIconName, src]);
|
|
25436
|
-
const Container = useCenter ?
|
|
25825
|
+
const Container = useCenter ? Center15 : Box48;
|
|
25437
25826
|
if (!src) return null;
|
|
25438
25827
|
if (IconComponent) {
|
|
25439
|
-
return /* @__PURE__ */
|
|
25828
|
+
return /* @__PURE__ */ React242.createElement(
|
|
25440
25829
|
Container,
|
|
25441
25830
|
{
|
|
25442
25831
|
style: {
|
|
@@ -25448,10 +25837,10 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
25448
25837
|
...style
|
|
25449
25838
|
}
|
|
25450
25839
|
},
|
|
25451
|
-
/* @__PURE__ */
|
|
25840
|
+
/* @__PURE__ */ React242.createElement(IconComponent, { size: iconSize, color: "white", stroke: 1.5 })
|
|
25452
25841
|
);
|
|
25453
25842
|
}
|
|
25454
|
-
return /* @__PURE__ */
|
|
25843
|
+
return /* @__PURE__ */ React242.createElement(
|
|
25455
25844
|
"img",
|
|
25456
25845
|
{
|
|
25457
25846
|
src,
|
|
@@ -25472,14 +25861,14 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
25472
25861
|
import { useDisclosure as useDisclosure5 } from "@mantine/hooks";
|
|
25473
25862
|
function CoverImage({ coverImageUrl, logoUrl }) {
|
|
25474
25863
|
const { editor, handlers, editable } = useBlocknoteContext();
|
|
25475
|
-
const [isHovering, setIsHovering] =
|
|
25476
|
-
const [isRepositioning, setIsRepositioning] =
|
|
25477
|
-
const [coverPosition, setCoverPosition] =
|
|
25478
|
-
const coverFileInputRef =
|
|
25479
|
-
const logoFileInputRef =
|
|
25864
|
+
const [isHovering, setIsHovering] = useState92(false);
|
|
25865
|
+
const [isRepositioning, setIsRepositioning] = useState92(false);
|
|
25866
|
+
const [coverPosition, setCoverPosition] = useState92(50);
|
|
25867
|
+
const coverFileInputRef = useRef24(null);
|
|
25868
|
+
const logoFileInputRef = useRef24(null);
|
|
25480
25869
|
const [opened, { open, close }] = useDisclosure5(false);
|
|
25481
|
-
const [metadata, setMetadata] =
|
|
25482
|
-
|
|
25870
|
+
const [metadata, setMetadata] = useState92(() => editor?.getPageMetadata?.() || null);
|
|
25871
|
+
useEffect76(() => {
|
|
25483
25872
|
if (!editor?._metadataManager) {
|
|
25484
25873
|
return;
|
|
25485
25874
|
}
|
|
@@ -25561,8 +25950,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25561
25950
|
return null;
|
|
25562
25951
|
}
|
|
25563
25952
|
if (!hasCover) {
|
|
25564
|
-
return /* @__PURE__ */
|
|
25565
|
-
|
|
25953
|
+
return /* @__PURE__ */ React243.createElement(
|
|
25954
|
+
Box49,
|
|
25566
25955
|
{
|
|
25567
25956
|
style: {
|
|
25568
25957
|
position: "relative",
|
|
@@ -25574,8 +25963,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25574
25963
|
onMouseEnter: () => editable && setIsHovering(true),
|
|
25575
25964
|
onMouseLeave: () => editable && setIsHovering(false)
|
|
25576
25965
|
},
|
|
25577
|
-
/* @__PURE__ */
|
|
25578
|
-
|
|
25966
|
+
/* @__PURE__ */ React243.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "relative", height: "100%" } }, /* @__PURE__ */ React243.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }), /* @__PURE__ */ React243.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") }), editable && isHovering && !logoSrc && /* @__PURE__ */ React243.createElement(
|
|
25967
|
+
Group87,
|
|
25579
25968
|
{
|
|
25580
25969
|
gap: "xs",
|
|
25581
25970
|
style: {
|
|
@@ -25585,7 +25974,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25585
25974
|
zIndex: 10
|
|
25586
25975
|
}
|
|
25587
25976
|
},
|
|
25588
|
-
/* @__PURE__ */
|
|
25977
|
+
/* @__PURE__ */ React243.createElement(
|
|
25589
25978
|
BaseIconPicker,
|
|
25590
25979
|
{
|
|
25591
25980
|
opened,
|
|
@@ -25594,11 +25983,11 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25594
25983
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
25595
25984
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
25596
25985
|
},
|
|
25597
|
-
/* @__PURE__ */
|
|
25986
|
+
/* @__PURE__ */ React243.createElement(CoverImageButton, { onClick: open }, "Add icon")
|
|
25598
25987
|
),
|
|
25599
|
-
/* @__PURE__ */
|
|
25600
|
-
), logoSrc && /* @__PURE__ */
|
|
25601
|
-
|
|
25988
|
+
/* @__PURE__ */ React243.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Add cover")
|
|
25989
|
+
), logoSrc && /* @__PURE__ */ React243.createElement(
|
|
25990
|
+
Box49,
|
|
25602
25991
|
{
|
|
25603
25992
|
style: {
|
|
25604
25993
|
position: "relative",
|
|
@@ -25611,8 +26000,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25611
26000
|
zIndex: 11
|
|
25612
26001
|
}
|
|
25613
26002
|
},
|
|
25614
|
-
/* @__PURE__ */
|
|
25615
|
-
editable && isHovering && /* @__PURE__ */
|
|
26003
|
+
/* @__PURE__ */ React243.createElement(PageIcon, { src: logoSrc, useCenter: true, iconSize: 64 }),
|
|
26004
|
+
editable && isHovering && /* @__PURE__ */ React243.createElement(
|
|
25616
26005
|
"div",
|
|
25617
26006
|
{
|
|
25618
26007
|
style: {
|
|
@@ -25627,7 +26016,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25627
26016
|
alignItems: "center"
|
|
25628
26017
|
}
|
|
25629
26018
|
},
|
|
25630
|
-
/* @__PURE__ */
|
|
26019
|
+
/* @__PURE__ */ React243.createElement(
|
|
25631
26020
|
BaseIconPicker,
|
|
25632
26021
|
{
|
|
25633
26022
|
opened,
|
|
@@ -25636,16 +26025,16 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25636
26025
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
25637
26026
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
25638
26027
|
},
|
|
25639
|
-
/* @__PURE__ */
|
|
26028
|
+
/* @__PURE__ */ React243.createElement(CoverImageButton, { onClick: open }, "Change")
|
|
25640
26029
|
),
|
|
25641
|
-
/* @__PURE__ */
|
|
25642
|
-
/* @__PURE__ */
|
|
26030
|
+
/* @__PURE__ */ React243.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove"),
|
|
26031
|
+
/* @__PURE__ */ React243.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Add cover")
|
|
25643
26032
|
)
|
|
25644
26033
|
))
|
|
25645
26034
|
);
|
|
25646
26035
|
}
|
|
25647
|
-
return /* @__PURE__ */
|
|
25648
|
-
|
|
26036
|
+
return /* @__PURE__ */ React243.createElement(
|
|
26037
|
+
Box49,
|
|
25649
26038
|
{
|
|
25650
26039
|
style: {
|
|
25651
26040
|
position: "relative",
|
|
@@ -25664,7 +26053,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25664
26053
|
onMouseMove: handleMouseMove,
|
|
25665
26054
|
onClick: () => isRepositioning && setIsRepositioning(false)
|
|
25666
26055
|
},
|
|
25667
|
-
/* @__PURE__ */
|
|
26056
|
+
/* @__PURE__ */ React243.createElement(
|
|
25668
26057
|
"img",
|
|
25669
26058
|
{
|
|
25670
26059
|
src: coverUrl,
|
|
@@ -25682,8 +26071,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25682
26071
|
}
|
|
25683
26072
|
}
|
|
25684
26073
|
),
|
|
25685
|
-
editable && isHovering && /* @__PURE__ */
|
|
25686
|
-
|
|
26074
|
+
editable && isHovering && /* @__PURE__ */ React243.createElement(
|
|
26075
|
+
Group87,
|
|
25687
26076
|
{
|
|
25688
26077
|
gap: "xs",
|
|
25689
26078
|
style: {
|
|
@@ -25693,12 +26082,12 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25693
26082
|
zIndex: 10
|
|
25694
26083
|
}
|
|
25695
26084
|
},
|
|
25696
|
-
/* @__PURE__ */
|
|
25697
|
-
/* @__PURE__ */
|
|
25698
|
-
/* @__PURE__ */
|
|
26085
|
+
/* @__PURE__ */ React243.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Change cover"),
|
|
26086
|
+
/* @__PURE__ */ React243.createElement(CoverImageButton, { onClick: () => setIsRepositioning(!isRepositioning), isActive: isRepositioning }, isRepositioning ? "Done" : "Reposition"),
|
|
26087
|
+
/* @__PURE__ */ React243.createElement(CoverImageButton, { onClick: handleRemoveCover }, "Remove")
|
|
25699
26088
|
),
|
|
25700
|
-
/* @__PURE__ */
|
|
25701
|
-
|
|
26089
|
+
/* @__PURE__ */ React243.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: -40, right: 0, height: "70px" } }, /* @__PURE__ */ React243.createElement(
|
|
26090
|
+
Box49,
|
|
25702
26091
|
{
|
|
25703
26092
|
style: {
|
|
25704
26093
|
position: "absolute",
|
|
@@ -25709,9 +26098,9 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25709
26098
|
zIndex: 11
|
|
25710
26099
|
}
|
|
25711
26100
|
},
|
|
25712
|
-
logoSrc && /* @__PURE__ */
|
|
25713
|
-
editable && isHovering && /* @__PURE__ */
|
|
25714
|
-
|
|
26101
|
+
logoSrc && /* @__PURE__ */ React243.createElement(PageIcon, { src: logoSrc, iconSize: 64 }),
|
|
26102
|
+
editable && isHovering && /* @__PURE__ */ React243.createElement(React243.Fragment, null, logoSrc ? /* @__PURE__ */ React243.createElement(
|
|
26103
|
+
Group87,
|
|
25715
26104
|
{
|
|
25716
26105
|
gap: "xs",
|
|
25717
26106
|
style: {
|
|
@@ -25721,7 +26110,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25721
26110
|
zIndex: 12
|
|
25722
26111
|
}
|
|
25723
26112
|
},
|
|
25724
|
-
/* @__PURE__ */
|
|
26113
|
+
/* @__PURE__ */ React243.createElement(
|
|
25725
26114
|
BaseIconPicker,
|
|
25726
26115
|
{
|
|
25727
26116
|
opened,
|
|
@@ -25730,10 +26119,10 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25730
26119
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
25731
26120
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
25732
26121
|
},
|
|
25733
|
-
/* @__PURE__ */
|
|
26122
|
+
/* @__PURE__ */ React243.createElement(CoverImageButton, { onClick: open }, "Change")
|
|
25734
26123
|
),
|
|
25735
|
-
/* @__PURE__ */
|
|
25736
|
-
) : /* @__PURE__ */
|
|
26124
|
+
/* @__PURE__ */ React243.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove")
|
|
26125
|
+
) : /* @__PURE__ */ React243.createElement(
|
|
25737
26126
|
CoverImageButton,
|
|
25738
26127
|
{
|
|
25739
26128
|
onClick: open,
|
|
@@ -25748,13 +26137,13 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25748
26137
|
"Add icon"
|
|
25749
26138
|
))
|
|
25750
26139
|
)),
|
|
25751
|
-
/* @__PURE__ */
|
|
25752
|
-
/* @__PURE__ */
|
|
26140
|
+
/* @__PURE__ */ React243.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
|
|
26141
|
+
/* @__PURE__ */ React243.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") })
|
|
25753
26142
|
);
|
|
25754
26143
|
}
|
|
25755
26144
|
|
|
25756
26145
|
// src/mantine/components/PageHeader.tsx
|
|
25757
|
-
import
|
|
26146
|
+
import React244, { useState as useState93, useRef as useRef25, useEffect as useEffect77 } from "react";
|
|
25758
26147
|
function PageHeader({
|
|
25759
26148
|
title = "New page",
|
|
25760
26149
|
icon: icon2,
|
|
@@ -25766,11 +26155,11 @@ function PageHeader({
|
|
|
25766
26155
|
isFavorited = false,
|
|
25767
26156
|
menuItems = []
|
|
25768
26157
|
}) {
|
|
25769
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
25770
|
-
const [isPrivacyOpen, setIsPrivacyOpen] =
|
|
25771
|
-
const menuRef =
|
|
25772
|
-
const privacyRef =
|
|
25773
|
-
|
|
26158
|
+
const [isMenuOpen, setIsMenuOpen] = useState93(false);
|
|
26159
|
+
const [isPrivacyOpen, setIsPrivacyOpen] = useState93(false);
|
|
26160
|
+
const menuRef = useRef25(null);
|
|
26161
|
+
const privacyRef = useRef25(null);
|
|
26162
|
+
useEffect77(() => {
|
|
25774
26163
|
function handleClickOutside(event) {
|
|
25775
26164
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
25776
26165
|
setIsMenuOpen(false);
|
|
@@ -25792,7 +26181,7 @@ function PageHeader({
|
|
|
25792
26181
|
setIsMenuOpen(false);
|
|
25793
26182
|
}
|
|
25794
26183
|
};
|
|
25795
|
-
return /* @__PURE__ */
|
|
26184
|
+
return /* @__PURE__ */ React244.createElement("div", { style: styles.container }, /* @__PURE__ */ React244.createElement("div", { style: styles.leftSection }, /* @__PURE__ */ React244.createElement("span", { style: styles.icon }, icon2 || "\u{1F4C4}"), /* @__PURE__ */ React244.createElement("span", { style: styles.title }, title), /* @__PURE__ */ React244.createElement("div", { style: styles.privacyContainer, ref: privacyRef }, /* @__PURE__ */ React244.createElement("button", { style: styles.privacyBadge, onClick: () => onPrivacyChange && setIsPrivacyOpen(!isPrivacyOpen) }, /* @__PURE__ */ React244.createElement("span", { style: styles.lockIcon }, isPrivate ? "\u{1F512}" : "\u{1F310}"), /* @__PURE__ */ React244.createElement("span", null, isPrivate ? "Private" : "Public"), onPrivacyChange && /* @__PURE__ */ React244.createElement("span", { style: styles.chevron }, "\u25BE")), isPrivacyOpen && onPrivacyChange && /* @__PURE__ */ React244.createElement("div", { style: styles.dropdown }, /* @__PURE__ */ React244.createElement(
|
|
25796
26185
|
"button",
|
|
25797
26186
|
{
|
|
25798
26187
|
style: {
|
|
@@ -25804,9 +26193,9 @@ function PageHeader({
|
|
|
25804
26193
|
setIsPrivacyOpen(false);
|
|
25805
26194
|
}
|
|
25806
26195
|
},
|
|
25807
|
-
/* @__PURE__ */
|
|
25808
|
-
/* @__PURE__ */
|
|
25809
|
-
), /* @__PURE__ */
|
|
26196
|
+
/* @__PURE__ */ React244.createElement("span", { style: styles.menuItemIcon }, "\u{1F512}"),
|
|
26197
|
+
/* @__PURE__ */ React244.createElement("span", null, "Private")
|
|
26198
|
+
), /* @__PURE__ */ React244.createElement(
|
|
25810
26199
|
"button",
|
|
25811
26200
|
{
|
|
25812
26201
|
style: {
|
|
@@ -25818,9 +26207,9 @@ function PageHeader({
|
|
|
25818
26207
|
setIsPrivacyOpen(false);
|
|
25819
26208
|
}
|
|
25820
26209
|
},
|
|
25821
|
-
/* @__PURE__ */
|
|
25822
|
-
/* @__PURE__ */
|
|
25823
|
-
)))), /* @__PURE__ */
|
|
26210
|
+
/* @__PURE__ */ React244.createElement("span", { style: styles.menuItemIcon }, "\u{1F310}"),
|
|
26211
|
+
/* @__PURE__ */ React244.createElement("span", null, "Public")
|
|
26212
|
+
)))), /* @__PURE__ */ React244.createElement("div", { style: styles.rightSection }, lastEdited && /* @__PURE__ */ React244.createElement("span", { style: styles.editedText }, lastEdited), onShare && /* @__PURE__ */ React244.createElement("button", { style: styles.shareButton, onClick: onShare }, "Share"), onFavorite && /* @__PURE__ */ React244.createElement("button", { style: styles.iconButton, onClick: onFavorite }, isFavorited ? "\u2605" : "\u2606"), menuItems.length > 0 && /* @__PURE__ */ React244.createElement("div", { style: styles.menuContainer, ref: menuRef }, /* @__PURE__ */ React244.createElement("button", { style: styles.menuButton, onClick: () => setIsMenuOpen(!isMenuOpen), "aria-label": "Menu" }, /* @__PURE__ */ React244.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor" }, /* @__PURE__ */ React244.createElement("circle", { cx: "3", cy: "8", r: "1.5" }), /* @__PURE__ */ React244.createElement("circle", { cx: "8", cy: "8", r: "1.5" }), /* @__PURE__ */ React244.createElement("circle", { cx: "13", cy: "8", r: "1.5" }))), isMenuOpen && /* @__PURE__ */ React244.createElement("div", { style: styles.dropdown }, menuItems.map((item, index) => /* @__PURE__ */ React244.createElement(React244.Fragment, { key: index }, item.divider && index > 0 && /* @__PURE__ */ React244.createElement("div", { style: styles.divider }), /* @__PURE__ */ React244.createElement(
|
|
25824
26213
|
"button",
|
|
25825
26214
|
{
|
|
25826
26215
|
style: {
|
|
@@ -25830,8 +26219,8 @@ function PageHeader({
|
|
|
25830
26219
|
onClick: () => handleMenuItemClick(item),
|
|
25831
26220
|
disabled: item.disabled
|
|
25832
26221
|
},
|
|
25833
|
-
item.icon && /* @__PURE__ */
|
|
25834
|
-
/* @__PURE__ */
|
|
26222
|
+
item.icon && /* @__PURE__ */ React244.createElement("span", { style: styles.menuItemIcon }, item.icon),
|
|
26223
|
+
/* @__PURE__ */ React244.createElement("span", null, item.label)
|
|
25835
26224
|
)))))));
|
|
25836
26225
|
}
|
|
25837
26226
|
var styles = {
|
|
@@ -25968,8 +26357,8 @@ var styles = {
|
|
|
25968
26357
|
};
|
|
25969
26358
|
|
|
25970
26359
|
// src/mantine/components/ExternalDropZone.tsx
|
|
25971
|
-
import
|
|
25972
|
-
import { Box as
|
|
26360
|
+
import React245, { useCallback as useCallback72, useEffect as useEffect78, useRef as useRef26, useState as useState94 } from "react";
|
|
26361
|
+
import { Box as Box50 } from "@mantine/core";
|
|
25973
26362
|
var SCROLL_ZONE_SIZE = 80;
|
|
25974
26363
|
var SCROLL_SPEED = 12;
|
|
25975
26364
|
var ExternalDropZone = ({
|
|
@@ -25981,20 +26370,20 @@ var ExternalDropZone = ({
|
|
|
25981
26370
|
onPlacementCancel,
|
|
25982
26371
|
children
|
|
25983
26372
|
}) => {
|
|
25984
|
-
const containerRef =
|
|
25985
|
-
const [isValidDrag, setIsValidDrag] =
|
|
25986
|
-
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] =
|
|
25987
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
25988
|
-
const dropPositionRef =
|
|
25989
|
-
const scrollAnimationRef =
|
|
25990
|
-
const scrollDirectionRef =
|
|
25991
|
-
const scrollContainerRef =
|
|
25992
|
-
const getBlockElements =
|
|
26373
|
+
const containerRef = useRef26(null);
|
|
26374
|
+
const [isValidDrag, setIsValidDrag] = useState94(false);
|
|
26375
|
+
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState94(false);
|
|
26376
|
+
const [indicatorStyle, setIndicatorStyle] = useState94({});
|
|
26377
|
+
const dropPositionRef = useRef26(null);
|
|
26378
|
+
const scrollAnimationRef = useRef26(null);
|
|
26379
|
+
const scrollDirectionRef = useRef26(null);
|
|
26380
|
+
const scrollContainerRef = useRef26(null);
|
|
26381
|
+
const getBlockElements = useCallback72(() => {
|
|
25993
26382
|
if (!containerRef.current) return [];
|
|
25994
26383
|
const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
|
|
25995
26384
|
return Array.from(blocks);
|
|
25996
26385
|
}, []);
|
|
25997
|
-
const getScrollContainer =
|
|
26386
|
+
const getScrollContainer = useCallback72(() => {
|
|
25998
26387
|
if (scrollContainerRef.current) return scrollContainerRef.current;
|
|
25999
26388
|
let element = containerRef.current;
|
|
26000
26389
|
while (element) {
|
|
@@ -26009,7 +26398,7 @@ var ExternalDropZone = ({
|
|
|
26009
26398
|
scrollContainerRef.current = window;
|
|
26010
26399
|
return window;
|
|
26011
26400
|
}, []);
|
|
26012
|
-
const performScroll =
|
|
26401
|
+
const performScroll = useCallback72(() => {
|
|
26013
26402
|
const container = getScrollContainer();
|
|
26014
26403
|
const direction = scrollDirectionRef.current;
|
|
26015
26404
|
if (!direction) {
|
|
@@ -26024,7 +26413,7 @@ var ExternalDropZone = ({
|
|
|
26024
26413
|
}
|
|
26025
26414
|
scrollAnimationRef.current = requestAnimationFrame(performScroll);
|
|
26026
26415
|
}, [getScrollContainer]);
|
|
26027
|
-
const startAutoScroll =
|
|
26416
|
+
const startAutoScroll = useCallback72(
|
|
26028
26417
|
(direction) => {
|
|
26029
26418
|
if (scrollDirectionRef.current === direction) return;
|
|
26030
26419
|
scrollDirectionRef.current = direction;
|
|
@@ -26034,14 +26423,14 @@ var ExternalDropZone = ({
|
|
|
26034
26423
|
},
|
|
26035
26424
|
[performScroll]
|
|
26036
26425
|
);
|
|
26037
|
-
const stopAutoScroll =
|
|
26426
|
+
const stopAutoScroll = useCallback72(() => {
|
|
26038
26427
|
scrollDirectionRef.current = null;
|
|
26039
26428
|
if (scrollAnimationRef.current) {
|
|
26040
26429
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
26041
26430
|
scrollAnimationRef.current = null;
|
|
26042
26431
|
}
|
|
26043
26432
|
}, []);
|
|
26044
|
-
const checkAutoScroll =
|
|
26433
|
+
const checkAutoScroll = useCallback72(
|
|
26045
26434
|
(clientY) => {
|
|
26046
26435
|
const container = getScrollContainer();
|
|
26047
26436
|
let containerTop;
|
|
@@ -26064,7 +26453,7 @@ var ExternalDropZone = ({
|
|
|
26064
26453
|
},
|
|
26065
26454
|
[getScrollContainer, startAutoScroll, stopAutoScroll]
|
|
26066
26455
|
);
|
|
26067
|
-
const findDropPosition =
|
|
26456
|
+
const findDropPosition = useCallback72(
|
|
26068
26457
|
(clientY) => {
|
|
26069
26458
|
const blocks = getBlockElements();
|
|
26070
26459
|
if (blocks.length === 0 || !editor?.document) return null;
|
|
@@ -26097,7 +26486,7 @@ var ExternalDropZone = ({
|
|
|
26097
26486
|
},
|
|
26098
26487
|
[getBlockElements, editor]
|
|
26099
26488
|
);
|
|
26100
|
-
const handleDragOver =
|
|
26489
|
+
const handleDragOver = useCallback72(
|
|
26101
26490
|
(e) => {
|
|
26102
26491
|
if (!e.dataTransfer.types.includes(acceptedType)) return;
|
|
26103
26492
|
e.preventDefault();
|
|
@@ -26120,7 +26509,7 @@ var ExternalDropZone = ({
|
|
|
26120
26509
|
},
|
|
26121
26510
|
[acceptedType, findDropPosition, checkAutoScroll]
|
|
26122
26511
|
);
|
|
26123
|
-
const handleDragLeave =
|
|
26512
|
+
const handleDragLeave = useCallback72(
|
|
26124
26513
|
(e) => {
|
|
26125
26514
|
if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) {
|
|
26126
26515
|
setIsValidDrag(false);
|
|
@@ -26130,7 +26519,7 @@ var ExternalDropZone = ({
|
|
|
26130
26519
|
},
|
|
26131
26520
|
[stopAutoScroll]
|
|
26132
26521
|
);
|
|
26133
|
-
const handleDrop =
|
|
26522
|
+
const handleDrop = useCallback72(
|
|
26134
26523
|
(e) => {
|
|
26135
26524
|
e.preventDefault();
|
|
26136
26525
|
e.stopPropagation();
|
|
@@ -26144,7 +26533,7 @@ var ExternalDropZone = ({
|
|
|
26144
26533
|
},
|
|
26145
26534
|
[onDrop, stopAutoScroll]
|
|
26146
26535
|
);
|
|
26147
|
-
|
|
26536
|
+
useEffect78(() => {
|
|
26148
26537
|
const handleGlobalDragEnd = () => {
|
|
26149
26538
|
setIsValidDrag(false);
|
|
26150
26539
|
dropPositionRef.current = null;
|
|
@@ -26153,7 +26542,7 @@ var ExternalDropZone = ({
|
|
|
26153
26542
|
window.addEventListener("dragend", handleGlobalDragEnd);
|
|
26154
26543
|
return () => window.removeEventListener("dragend", handleGlobalDragEnd);
|
|
26155
26544
|
}, [stopAutoScroll]);
|
|
26156
|
-
const handleOverlayMouseMove =
|
|
26545
|
+
const handleOverlayMouseMove = useCallback72(
|
|
26157
26546
|
(e) => {
|
|
26158
26547
|
setIsHoveringInPlacementMode(true);
|
|
26159
26548
|
checkAutoScroll(e.clientY);
|
|
@@ -26172,12 +26561,12 @@ var ExternalDropZone = ({
|
|
|
26172
26561
|
},
|
|
26173
26562
|
[findDropPosition, checkAutoScroll]
|
|
26174
26563
|
);
|
|
26175
|
-
const handleOverlayMouseLeave =
|
|
26564
|
+
const handleOverlayMouseLeave = useCallback72(() => {
|
|
26176
26565
|
setIsHoveringInPlacementMode(false);
|
|
26177
26566
|
dropPositionRef.current = null;
|
|
26178
26567
|
stopAutoScroll();
|
|
26179
26568
|
}, [stopAutoScroll]);
|
|
26180
|
-
const handleOverlayClick =
|
|
26569
|
+
const handleOverlayClick = useCallback72(
|
|
26181
26570
|
(e) => {
|
|
26182
26571
|
e.preventDefault();
|
|
26183
26572
|
e.stopPropagation();
|
|
@@ -26191,7 +26580,7 @@ var ExternalDropZone = ({
|
|
|
26191
26580
|
},
|
|
26192
26581
|
[onDrop, stopAutoScroll]
|
|
26193
26582
|
);
|
|
26194
|
-
const handleOverlayWheel =
|
|
26583
|
+
const handleOverlayWheel = useCallback72(
|
|
26195
26584
|
(e) => {
|
|
26196
26585
|
const container = getScrollContainer();
|
|
26197
26586
|
if (container === window) {
|
|
@@ -26202,7 +26591,7 @@ var ExternalDropZone = ({
|
|
|
26202
26591
|
},
|
|
26203
26592
|
[getScrollContainer]
|
|
26204
26593
|
);
|
|
26205
|
-
|
|
26594
|
+
useEffect78(() => {
|
|
26206
26595
|
if (!isPlacementMode) return;
|
|
26207
26596
|
const handleKeyDown = (e) => {
|
|
26208
26597
|
if (e.key === "Escape") {
|
|
@@ -26225,13 +26614,13 @@ var ExternalDropZone = ({
|
|
|
26225
26614
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
26226
26615
|
};
|
|
26227
26616
|
}, [isPlacementMode, onPlacementCancel]);
|
|
26228
|
-
|
|
26617
|
+
useEffect78(() => {
|
|
26229
26618
|
if (!isPlacementMode) {
|
|
26230
26619
|
setIsHoveringInPlacementMode(false);
|
|
26231
26620
|
dropPositionRef.current = null;
|
|
26232
26621
|
}
|
|
26233
26622
|
}, [isPlacementMode]);
|
|
26234
|
-
|
|
26623
|
+
useEffect78(() => {
|
|
26235
26624
|
const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
26236
26625
|
if (isActive) {
|
|
26237
26626
|
document.body.classList.add("external-artifact-drag-active");
|
|
@@ -26242,19 +26631,19 @@ var ExternalDropZone = ({
|
|
|
26242
26631
|
document.body.classList.remove("external-artifact-drag-active");
|
|
26243
26632
|
};
|
|
26244
26633
|
}, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
|
|
26245
|
-
|
|
26634
|
+
useEffect78(() => {
|
|
26246
26635
|
return () => {
|
|
26247
26636
|
if (scrollAnimationRef.current) {
|
|
26248
26637
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
26249
26638
|
}
|
|
26250
26639
|
};
|
|
26251
26640
|
}, []);
|
|
26252
|
-
const indicatorWithPosition = dropIndicator &&
|
|
26641
|
+
const indicatorWithPosition = dropIndicator && React245.isValidElement(dropIndicator) ? React245.cloneElement(dropIndicator, {
|
|
26253
26642
|
indicatorTop: typeof indicatorStyle.top === "number" ? indicatorStyle.top : void 0
|
|
26254
26643
|
}) : dropIndicator;
|
|
26255
26644
|
const shouldShowIndicator = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
26256
|
-
return /* @__PURE__ */
|
|
26257
|
-
|
|
26645
|
+
return /* @__PURE__ */ React245.createElement(
|
|
26646
|
+
Box50,
|
|
26258
26647
|
{
|
|
26259
26648
|
ref: containerRef,
|
|
26260
26649
|
style: {
|
|
@@ -26269,8 +26658,8 @@ var ExternalDropZone = ({
|
|
|
26269
26658
|
"data-placement-mode": isPlacementMode ? "true" : void 0
|
|
26270
26659
|
},
|
|
26271
26660
|
children,
|
|
26272
|
-
isPlacementMode && /* @__PURE__ */
|
|
26273
|
-
|
|
26661
|
+
isPlacementMode && /* @__PURE__ */ React245.createElement(
|
|
26662
|
+
Box50,
|
|
26274
26663
|
{
|
|
26275
26664
|
style: {
|
|
26276
26665
|
position: "absolute",
|
|
@@ -26289,7 +26678,7 @@ var ExternalDropZone = ({
|
|
|
26289
26678
|
onWheel: handleOverlayWheel
|
|
26290
26679
|
}
|
|
26291
26680
|
),
|
|
26292
|
-
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */
|
|
26681
|
+
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React245.createElement(Box50, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
|
|
26293
26682
|
);
|
|
26294
26683
|
};
|
|
26295
26684
|
|
|
@@ -26315,8 +26704,8 @@ function IxoEditorContent({
|
|
|
26315
26704
|
}) {
|
|
26316
26705
|
const { activePanel } = usePanelStore();
|
|
26317
26706
|
const isPanelOpen = activePanel !== null;
|
|
26318
|
-
const [isRoomPrivate, setIsRoomPrivate] =
|
|
26319
|
-
|
|
26707
|
+
const [isRoomPrivate, setIsRoomPrivate] = useState95(pageHeaderProps?.isPrivate ?? true);
|
|
26708
|
+
useEffect79(() => {
|
|
26320
26709
|
const matrixClient = editor.getMatrixClient?.();
|
|
26321
26710
|
const roomId = editor.getRoomId?.();
|
|
26322
26711
|
if (!matrixClient || !roomId) return;
|
|
@@ -26332,7 +26721,7 @@ function IxoEditorContent({
|
|
|
26332
26721
|
} catch {
|
|
26333
26722
|
}
|
|
26334
26723
|
}, [editor]);
|
|
26335
|
-
const handlePrivacyChange =
|
|
26724
|
+
const handlePrivacyChange = useCallback73(
|
|
26336
26725
|
async (makePrivate) => {
|
|
26337
26726
|
const matrixClient = editor.getMatrixClient?.();
|
|
26338
26727
|
const roomId = editor.getRoomId?.();
|
|
@@ -26353,7 +26742,7 @@ function IxoEditorContent({
|
|
|
26353
26742
|
},
|
|
26354
26743
|
[editor]
|
|
26355
26744
|
);
|
|
26356
|
-
const editorContent = /* @__PURE__ */
|
|
26745
|
+
const editorContent = /* @__PURE__ */ React246.createElement(
|
|
26357
26746
|
BlockNoteView,
|
|
26358
26747
|
{
|
|
26359
26748
|
editor,
|
|
@@ -26368,7 +26757,7 @@ function IxoEditorContent({
|
|
|
26368
26757
|
onChange,
|
|
26369
26758
|
onSelectionChange
|
|
26370
26759
|
},
|
|
26371
|
-
config.slashMenu && /* @__PURE__ */
|
|
26760
|
+
config.slashMenu && /* @__PURE__ */ React246.createElement(
|
|
26372
26761
|
SuggestionMenuController,
|
|
26373
26762
|
{
|
|
26374
26763
|
triggerCharacter: "/",
|
|
@@ -26387,7 +26776,7 @@ function IxoEditorContent({
|
|
|
26387
26776
|
),
|
|
26388
26777
|
children
|
|
26389
26778
|
);
|
|
26390
|
-
return /* @__PURE__ */
|
|
26779
|
+
return /* @__PURE__ */ React246.createElement("div", { style: { display: "flex", height: "100%", width: "100%", gap: 0 } }, /* @__PURE__ */ React246.createElement(
|
|
26391
26780
|
"div",
|
|
26392
26781
|
{
|
|
26393
26782
|
className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`,
|
|
@@ -26396,9 +26785,9 @@ function IxoEditorContent({
|
|
|
26396
26785
|
transition: "width 0.2s ease"
|
|
26397
26786
|
}
|
|
26398
26787
|
},
|
|
26399
|
-
selfNav && /* @__PURE__ */
|
|
26400
|
-
/* @__PURE__ */
|
|
26401
|
-
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */
|
|
26788
|
+
selfNav && /* @__PURE__ */ React246.createElement(PageHeader, { ...pageHeaderProps, isPrivate: isRoomPrivate, onPrivacyChange: handlePrivacyChange }),
|
|
26789
|
+
/* @__PURE__ */ React246.createElement(CoverImage, { coverImageUrl, logoUrl }),
|
|
26790
|
+
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */ React246.createElement(
|
|
26402
26791
|
ExternalDropZone,
|
|
26403
26792
|
{
|
|
26404
26793
|
editor,
|
|
@@ -26411,7 +26800,7 @@ function IxoEditorContent({
|
|
|
26411
26800
|
},
|
|
26412
26801
|
editorContent
|
|
26413
26802
|
) : editorContent
|
|
26414
|
-
), isPanelVisible && /* @__PURE__ */
|
|
26803
|
+
), isPanelVisible && /* @__PURE__ */ React246.createElement(PanelContent, { theme: config.theme }));
|
|
26415
26804
|
}
|
|
26416
26805
|
function IxoEditor({
|
|
26417
26806
|
editor,
|
|
@@ -26436,7 +26825,8 @@ function IxoEditor({
|
|
|
26436
26825
|
externalDropType,
|
|
26437
26826
|
dropIndicator,
|
|
26438
26827
|
isPlacementMode,
|
|
26439
|
-
onPlacementCancel
|
|
26828
|
+
onPlacementCancel,
|
|
26829
|
+
mapConfig
|
|
26440
26830
|
}) {
|
|
26441
26831
|
if (!editor) {
|
|
26442
26832
|
return null;
|
|
@@ -26451,7 +26841,7 @@ function IxoEditor({
|
|
|
26451
26841
|
tableHandles: true
|
|
26452
26842
|
};
|
|
26453
26843
|
const isEditable = editable;
|
|
26454
|
-
const editorContent = /* @__PURE__ */
|
|
26844
|
+
const editorContent = /* @__PURE__ */ React246.createElement(
|
|
26455
26845
|
BlocknoteProvider,
|
|
26456
26846
|
{
|
|
26457
26847
|
editor,
|
|
@@ -26461,9 +26851,10 @@ function IxoEditor({
|
|
|
26461
26851
|
visualizationRenderer,
|
|
26462
26852
|
getDynamicListData,
|
|
26463
26853
|
dynamicListPanelRenderer,
|
|
26464
|
-
domainCardRenderer
|
|
26854
|
+
domainCardRenderer,
|
|
26855
|
+
mapConfig
|
|
26465
26856
|
},
|
|
26466
|
-
/* @__PURE__ */
|
|
26857
|
+
/* @__PURE__ */ React246.createElement(
|
|
26467
26858
|
IxoEditorContent,
|
|
26468
26859
|
{
|
|
26469
26860
|
isPanelVisible,
|
|
@@ -26487,14 +26878,14 @@ function IxoEditor({
|
|
|
26487
26878
|
)
|
|
26488
26879
|
);
|
|
26489
26880
|
if (mantineTheme) {
|
|
26490
|
-
return /* @__PURE__ */
|
|
26881
|
+
return /* @__PURE__ */ React246.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
|
|
26491
26882
|
}
|
|
26492
26883
|
return editorContent;
|
|
26493
26884
|
}
|
|
26494
26885
|
|
|
26495
26886
|
// src/mantine/components/EntitySigningSetup.tsx
|
|
26496
|
-
import
|
|
26497
|
-
import { Modal as Modal3, Stack as
|
|
26887
|
+
import React247, { useState as useState96 } from "react";
|
|
26888
|
+
import { Modal as Modal3, Stack as Stack155, Text as Text133, TextInput as TextInput8, Button as Button39, Alert as Alert34, Group as Group88 } from "@mantine/core";
|
|
26498
26889
|
import { IconAlertCircle as IconAlertCircle18, IconCheck as IconCheck15, IconKey as IconKey2 } from "@tabler/icons-react";
|
|
26499
26890
|
var EntitySigningSetup = ({
|
|
26500
26891
|
opened,
|
|
@@ -26503,11 +26894,11 @@ var EntitySigningSetup = ({
|
|
|
26503
26894
|
entityName,
|
|
26504
26895
|
onSetup
|
|
26505
26896
|
}) => {
|
|
26506
|
-
const [pin, setPin] =
|
|
26507
|
-
const [confirmPin, setConfirmPin] =
|
|
26508
|
-
const [loading, setLoading] =
|
|
26509
|
-
const [error, setError] =
|
|
26510
|
-
const [success, setSuccess] =
|
|
26897
|
+
const [pin, setPin] = useState96("");
|
|
26898
|
+
const [confirmPin, setConfirmPin] = useState96("");
|
|
26899
|
+
const [loading, setLoading] = useState96(false);
|
|
26900
|
+
const [error, setError] = useState96(null);
|
|
26901
|
+
const [success, setSuccess] = useState96(false);
|
|
26511
26902
|
const handleSetup = async () => {
|
|
26512
26903
|
if (pin.length < 4) {
|
|
26513
26904
|
setError("PIN must be at least 4 characters");
|
|
@@ -26547,15 +26938,15 @@ var EntitySigningSetup = ({
|
|
|
26547
26938
|
setSuccess(false);
|
|
26548
26939
|
}
|
|
26549
26940
|
};
|
|
26550
|
-
return /* @__PURE__ */
|
|
26941
|
+
return /* @__PURE__ */ React247.createElement(
|
|
26551
26942
|
Modal3,
|
|
26552
26943
|
{
|
|
26553
26944
|
opened,
|
|
26554
26945
|
onClose: handleClose,
|
|
26555
|
-
title: /* @__PURE__ */
|
|
26946
|
+
title: /* @__PURE__ */ React247.createElement(Group88, { gap: "xs" }, /* @__PURE__ */ React247.createElement(IconKey2, { size: 20 }), /* @__PURE__ */ React247.createElement(Text133, { fw: 600 }, "Entity Signing Setup")),
|
|
26556
26947
|
size: "md"
|
|
26557
26948
|
},
|
|
26558
|
-
/* @__PURE__ */
|
|
26949
|
+
/* @__PURE__ */ React247.createElement(Stack155, { gap: "md" }, success ? /* @__PURE__ */ React247.createElement(Alert34, { color: "green", icon: /* @__PURE__ */ React247.createElement(IconCheck15, { size: 16 }) }, "Entity signing key set up successfully!") : /* @__PURE__ */ React247.createElement(React247.Fragment, null, /* @__PURE__ */ React247.createElement(Text133, { size: "sm", c: "dimmed" }, "Flow authorization requires a signing key for", " ", /* @__PURE__ */ React247.createElement(Text133, { span: true, fw: 500 }, entityName || entityDid), "."), /* @__PURE__ */ React247.createElement(Alert34, { color: "blue", variant: "light" }, /* @__PURE__ */ React247.createElement(Text133, { size: "sm" }, "This is a ", /* @__PURE__ */ React247.createElement("strong", null, "one-time setup"), " that allows flows to grant permissions without requiring wallet signatures for each delegation.")), /* @__PURE__ */ React247.createElement(Stack155, { gap: "xs" }, /* @__PURE__ */ React247.createElement(Text133, { size: "sm", fw: 500 }, "What happens:"), /* @__PURE__ */ React247.createElement(Text133, { size: "sm", c: "dimmed" }, "1. A new signing key is generated"), /* @__PURE__ */ React247.createElement(Text133, { size: "sm", c: "dimmed" }, "2. Key is registered on the entity's DID document (requires wallet)"), /* @__PURE__ */ React247.createElement(Text133, { size: "sm", c: "dimmed" }, "3. Key is stored encrypted in the entity's Matrix room")), /* @__PURE__ */ React247.createElement(
|
|
26559
26950
|
TextInput8,
|
|
26560
26951
|
{
|
|
26561
26952
|
label: "Enter PIN to encrypt signing key",
|
|
@@ -26566,7 +26957,7 @@ var EntitySigningSetup = ({
|
|
|
26566
26957
|
onChange: (e) => setPin(e.currentTarget.value),
|
|
26567
26958
|
disabled: loading
|
|
26568
26959
|
}
|
|
26569
|
-
), /* @__PURE__ */
|
|
26960
|
+
), /* @__PURE__ */ React247.createElement(
|
|
26570
26961
|
TextInput8,
|
|
26571
26962
|
{
|
|
26572
26963
|
label: "Confirm PIN",
|
|
@@ -26576,12 +26967,12 @@ var EntitySigningSetup = ({
|
|
|
26576
26967
|
onChange: (e) => setConfirmPin(e.currentTarget.value),
|
|
26577
26968
|
disabled: loading
|
|
26578
26969
|
}
|
|
26579
|
-
), error && /* @__PURE__ */
|
|
26970
|
+
), error && /* @__PURE__ */ React247.createElement(Alert34, { color: "red", icon: /* @__PURE__ */ React247.createElement(IconAlertCircle18, { size: 16 }) }, error), /* @__PURE__ */ React247.createElement(Group88, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React247.createElement(Button39, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React247.createElement(
|
|
26580
26971
|
Button39,
|
|
26581
26972
|
{
|
|
26582
26973
|
onClick: handleSetup,
|
|
26583
26974
|
loading,
|
|
26584
|
-
leftSection: /* @__PURE__ */
|
|
26975
|
+
leftSection: /* @__PURE__ */ React247.createElement(IconKey2, { size: 16 })
|
|
26585
26976
|
},
|
|
26586
26977
|
"Setup Entity Signing"
|
|
26587
26978
|
))))
|
|
@@ -26589,8 +26980,8 @@ var EntitySigningSetup = ({
|
|
|
26589
26980
|
};
|
|
26590
26981
|
|
|
26591
26982
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
26592
|
-
import
|
|
26593
|
-
import { Stack as
|
|
26983
|
+
import React248, { useState as useState97, useEffect as useEffect80, useMemo as useMemo90 } from "react";
|
|
26984
|
+
import { Stack as Stack156, Text as Text134, Paper as Paper16, Group as Group89, Badge as Badge40, Button as Button40, ActionIcon as ActionIcon31, Loader as Loader35, Alert as Alert35, Divider as Divider21 } from "@mantine/core";
|
|
26594
26985
|
import { IconPlus as IconPlus8, IconTrash as IconTrash8, IconShieldCheck as IconShieldCheck13, IconUser as IconUser12, IconRobot as IconRobot4, IconBuilding as IconBuilding2 } from "@tabler/icons-react";
|
|
26595
26986
|
var FlowPermissionsPanel = ({
|
|
26596
26987
|
editor,
|
|
@@ -26600,11 +26991,11 @@ var FlowPermissionsPanel = ({
|
|
|
26600
26991
|
onRevokePermission,
|
|
26601
26992
|
getUserDisplayName
|
|
26602
26993
|
}) => {
|
|
26603
|
-
const [delegations, setDelegations] =
|
|
26604
|
-
const [loading, setLoading] =
|
|
26605
|
-
const [revoking, setRevoking] =
|
|
26606
|
-
const rootCapability =
|
|
26607
|
-
|
|
26994
|
+
const [delegations, setDelegations] = useState97([]);
|
|
26995
|
+
const [loading, setLoading] = useState97(true);
|
|
26996
|
+
const [revoking, setRevoking] = useState97(null);
|
|
26997
|
+
const rootCapability = useMemo90(() => editor.getRootCapability?.(), [editor]);
|
|
26998
|
+
useEffect80(() => {
|
|
26608
26999
|
const loadDelegations = async () => {
|
|
26609
27000
|
setLoading(true);
|
|
26610
27001
|
const allDelegations = editor.getAllDelegations?.() || [];
|
|
@@ -26643,11 +27034,11 @@ var FlowPermissionsPanel = ({
|
|
|
26643
27034
|
const getIcon2 = (type) => {
|
|
26644
27035
|
switch (type) {
|
|
26645
27036
|
case "oracle":
|
|
26646
|
-
return /* @__PURE__ */
|
|
27037
|
+
return /* @__PURE__ */ React248.createElement(IconRobot4, { size: 16 });
|
|
26647
27038
|
case "entity":
|
|
26648
|
-
return /* @__PURE__ */
|
|
27039
|
+
return /* @__PURE__ */ React248.createElement(IconBuilding2, { size: 16 });
|
|
26649
27040
|
default:
|
|
26650
|
-
return /* @__PURE__ */
|
|
27041
|
+
return /* @__PURE__ */ React248.createElement(IconUser12, { size: 16 });
|
|
26651
27042
|
}
|
|
26652
27043
|
};
|
|
26653
27044
|
const formatCapabilities = (caps) => {
|
|
@@ -26666,7 +27057,7 @@ var FlowPermissionsPanel = ({
|
|
|
26666
27057
|
if (date < /* @__PURE__ */ new Date()) return "Expired";
|
|
26667
27058
|
return date.toLocaleDateString();
|
|
26668
27059
|
};
|
|
26669
|
-
return /* @__PURE__ */
|
|
27060
|
+
return /* @__PURE__ */ React248.createElement(Stack156, { gap: "md" }, /* @__PURE__ */ React248.createElement(Stack156, { gap: "xs" }, /* @__PURE__ */ React248.createElement(Text134, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React248.createElement(Paper16, { p: "sm", withBorder: true }, /* @__PURE__ */ React248.createElement(Group89, { gap: "xs" }, /* @__PURE__ */ React248.createElement(IconShieldCheck13, { size: 20, color: "var(--mantine-color-green-6)" }), /* @__PURE__ */ React248.createElement(Stack156, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React248.createElement(Text134, { size: "sm", fw: 500 }, entityName || entityDid), /* @__PURE__ */ React248.createElement(Text134, { size: "xs", c: "dimmed" }, rootCapability ? `Granted: ${new Date(rootCapability.issuedAt).toLocaleDateString()}` : "Root capability not set up")), /* @__PURE__ */ React248.createElement(Badge40, { color: "green", variant: "light" }, "Entity")))), /* @__PURE__ */ React248.createElement(Divider21, { label: "Delegated Permissions", labelPosition: "center" }), loading ? /* @__PURE__ */ React248.createElement(Group89, { justify: "center", py: "xl" }, /* @__PURE__ */ React248.createElement(Loader35, { size: "sm" })) : delegations.length === 0 ? /* @__PURE__ */ React248.createElement(Alert35, { color: "gray", variant: "light" }, /* @__PURE__ */ React248.createElement(Text134, { size: "sm" }, "No permissions have been granted yet.")) : /* @__PURE__ */ React248.createElement(Stack156, { gap: "xs" }, delegations.map(({ capability, displayName, type }) => /* @__PURE__ */ React248.createElement(Paper16, { key: capability.id, p: "sm", withBorder: true }, /* @__PURE__ */ React248.createElement(Group89, { justify: "space-between" }, /* @__PURE__ */ React248.createElement(Group89, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React248.createElement(Stack156, { gap: 2 }, /* @__PURE__ */ React248.createElement(Text134, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React248.createElement(Text134, { size: "xs", c: "dimmed" }, formatCapabilities(capability.capabilities)), /* @__PURE__ */ React248.createElement(Group89, { gap: "xs" }, /* @__PURE__ */ React248.createElement(Text134, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(capability.expiration)), /* @__PURE__ */ React248.createElement(Text134, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React248.createElement(Text134, { size: "xs", c: "dimmed" }, "Granted by: ", capability.issuer === entityDid ? "Entity" : capability.issuer.slice(-8))))), /* @__PURE__ */ React248.createElement(
|
|
26670
27061
|
ActionIcon31,
|
|
26671
27062
|
{
|
|
26672
27063
|
color: "red",
|
|
@@ -26675,11 +27066,11 @@ var FlowPermissionsPanel = ({
|
|
|
26675
27066
|
loading: revoking === capability.id,
|
|
26676
27067
|
disabled: !!revoking
|
|
26677
27068
|
},
|
|
26678
|
-
/* @__PURE__ */
|
|
26679
|
-
))))), /* @__PURE__ */
|
|
27069
|
+
/* @__PURE__ */ React248.createElement(IconTrash8, { size: 16 })
|
|
27070
|
+
))))), /* @__PURE__ */ React248.createElement(
|
|
26680
27071
|
Button40,
|
|
26681
27072
|
{
|
|
26682
|
-
leftSection: /* @__PURE__ */
|
|
27073
|
+
leftSection: /* @__PURE__ */ React248.createElement(IconPlus8, { size: 16 }),
|
|
26683
27074
|
variant: "light",
|
|
26684
27075
|
onClick: onGrantPermission
|
|
26685
27076
|
},
|
|
@@ -26688,22 +27079,22 @@ var FlowPermissionsPanel = ({
|
|
|
26688
27079
|
};
|
|
26689
27080
|
|
|
26690
27081
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
26691
|
-
import
|
|
27082
|
+
import React249, { useState as useState98, useCallback as useCallback74 } from "react";
|
|
26692
27083
|
import {
|
|
26693
27084
|
Modal as Modal4,
|
|
26694
|
-
Stack as
|
|
26695
|
-
Text as
|
|
27085
|
+
Stack as Stack157,
|
|
27086
|
+
Text as Text135,
|
|
26696
27087
|
TextInput as TextInput9,
|
|
26697
27088
|
Button as Button41,
|
|
26698
|
-
Group as
|
|
27089
|
+
Group as Group90,
|
|
26699
27090
|
Radio as Radio6,
|
|
26700
27091
|
Checkbox as Checkbox13,
|
|
26701
27092
|
Alert as Alert36,
|
|
26702
27093
|
Paper as Paper17,
|
|
26703
|
-
Loader as
|
|
27094
|
+
Loader as Loader36,
|
|
26704
27095
|
Badge as Badge41,
|
|
26705
27096
|
ActionIcon as ActionIcon32,
|
|
26706
|
-
Divider as
|
|
27097
|
+
Divider as Divider22,
|
|
26707
27098
|
NumberInput as NumberInput3
|
|
26708
27099
|
} from "@mantine/core";
|
|
26709
27100
|
import { IconSearch as IconSearch7, IconUser as IconUser13, IconRobot as IconRobot5, IconX as IconX14, IconShieldPlus as IconShieldPlus4 } from "@tabler/icons-react";
|
|
@@ -26720,21 +27111,21 @@ var GrantPermissionModal = ({
|
|
|
26720
27111
|
const singleBlockMode = !!targetBlockId || blocks.length === 1;
|
|
26721
27112
|
const fixedBlockId = targetBlockId || (blocks.length === 1 ? blocks[0].id : null);
|
|
26722
27113
|
const fixedBlock = fixedBlockId ? blocks.find((b) => b.id === fixedBlockId) || blocks[0] : null;
|
|
26723
|
-
const [recipientType, setRecipientType] =
|
|
26724
|
-
const [searchQuery, setSearchQuery] =
|
|
26725
|
-
const [searchResults, setSearchResults] =
|
|
26726
|
-
const [searching, setSearching] =
|
|
26727
|
-
const [selectedRecipient, setSelectedRecipient] =
|
|
26728
|
-
const [manualDid, setManualDid] =
|
|
26729
|
-
const [scopeType, setScopeType] =
|
|
26730
|
-
const [selectedBlocks, setSelectedBlocks] =
|
|
26731
|
-
const [expirationEnabled, setExpirationEnabled] =
|
|
26732
|
-
const [expirationDays, setExpirationDays] =
|
|
26733
|
-
const [canDelegate, setCanDelegate] =
|
|
26734
|
-
const [pin, setPin] =
|
|
26735
|
-
const [loading, setLoading] =
|
|
26736
|
-
const [error, setError] =
|
|
26737
|
-
const handleSearch =
|
|
27114
|
+
const [recipientType, setRecipientType] = useState98("user");
|
|
27115
|
+
const [searchQuery, setSearchQuery] = useState98("");
|
|
27116
|
+
const [searchResults, setSearchResults] = useState98([]);
|
|
27117
|
+
const [searching, setSearching] = useState98(false);
|
|
27118
|
+
const [selectedRecipient, setSelectedRecipient] = useState98(null);
|
|
27119
|
+
const [manualDid, setManualDid] = useState98("");
|
|
27120
|
+
const [scopeType, setScopeType] = useState98("full");
|
|
27121
|
+
const [selectedBlocks, setSelectedBlocks] = useState98([]);
|
|
27122
|
+
const [expirationEnabled, setExpirationEnabled] = useState98(false);
|
|
27123
|
+
const [expirationDays, setExpirationDays] = useState98(30);
|
|
27124
|
+
const [canDelegate, setCanDelegate] = useState98(false);
|
|
27125
|
+
const [pin, setPin] = useState98("");
|
|
27126
|
+
const [loading, setLoading] = useState98(false);
|
|
27127
|
+
const [error, setError] = useState98(null);
|
|
27128
|
+
const handleSearch = useCallback74(async () => {
|
|
26738
27129
|
if (searchQuery.length < 2) return;
|
|
26739
27130
|
setSearching(true);
|
|
26740
27131
|
try {
|
|
@@ -26821,29 +27212,29 @@ var GrantPermissionModal = ({
|
|
|
26821
27212
|
resetForm();
|
|
26822
27213
|
}
|
|
26823
27214
|
};
|
|
26824
|
-
return /* @__PURE__ */
|
|
27215
|
+
return /* @__PURE__ */ React249.createElement(
|
|
26825
27216
|
Modal4,
|
|
26826
27217
|
{
|
|
26827
27218
|
opened,
|
|
26828
27219
|
onClose: handleClose,
|
|
26829
|
-
title: /* @__PURE__ */
|
|
27220
|
+
title: /* @__PURE__ */ React249.createElement(Group90, { gap: "xs" }, /* @__PURE__ */ React249.createElement(IconShieldPlus4, { size: 20 }), /* @__PURE__ */ React249.createElement(Text135, { fw: 600 }, "Grant Permission")),
|
|
26830
27221
|
size: "lg"
|
|
26831
27222
|
},
|
|
26832
|
-
/* @__PURE__ */
|
|
27223
|
+
/* @__PURE__ */ React249.createElement(Stack157, { gap: "md" }, /* @__PURE__ */ React249.createElement(Stack157, { gap: "xs" }, /* @__PURE__ */ React249.createElement(Text135, { size: "sm", fw: 500 }, "Recipient Type"), /* @__PURE__ */ React249.createElement(Radio6.Group, { value: recipientType, onChange: (v) => {
|
|
26833
27224
|
setRecipientType(v);
|
|
26834
27225
|
setSelectedRecipient(null);
|
|
26835
27226
|
setSearchResults([]);
|
|
26836
|
-
} }, /* @__PURE__ */
|
|
27227
|
+
} }, /* @__PURE__ */ React249.createElement(Group90, null, /* @__PURE__ */ React249.createElement(Radio6, { value: "user", label: "User" }), /* @__PURE__ */ React249.createElement(Radio6, { value: "oracle", label: "Oracle" }), /* @__PURE__ */ React249.createElement(Radio6, { value: "manual", label: "Enter DID" })))), recipientType !== "manual" ? /* @__PURE__ */ React249.createElement(Stack157, { gap: "xs" }, /* @__PURE__ */ React249.createElement(
|
|
26837
27228
|
TextInput9,
|
|
26838
27229
|
{
|
|
26839
27230
|
placeholder: recipientType === "oracle" ? "Search oracles..." : "Search users...",
|
|
26840
|
-
leftSection: /* @__PURE__ */
|
|
26841
|
-
rightSection: searching ? /* @__PURE__ */
|
|
27231
|
+
leftSection: /* @__PURE__ */ React249.createElement(IconSearch7, { size: 16 }),
|
|
27232
|
+
rightSection: searching ? /* @__PURE__ */ React249.createElement(Loader36, { size: 14 }) : null,
|
|
26842
27233
|
value: searchQuery,
|
|
26843
27234
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
26844
27235
|
onKeyDown: (e) => e.key === "Enter" && handleSearch()
|
|
26845
27236
|
}
|
|
26846
|
-
), selectedRecipient ? /* @__PURE__ */
|
|
27237
|
+
), selectedRecipient ? /* @__PURE__ */ React249.createElement(Paper17, { p: "sm", withBorder: true }, /* @__PURE__ */ React249.createElement(Group90, { justify: "space-between" }, /* @__PURE__ */ React249.createElement(Group90, { gap: "xs" }, recipientType === "oracle" ? /* @__PURE__ */ React249.createElement(IconRobot5, { size: 16 }) : /* @__PURE__ */ React249.createElement(IconUser13, { size: 16 }), /* @__PURE__ */ React249.createElement(Text135, { size: "sm" }, selectedRecipient.displayName), /* @__PURE__ */ React249.createElement(Badge41, { size: "xs", variant: "light" }, selectedRecipient.did.slice(-12))), /* @__PURE__ */ React249.createElement(ActionIcon32, { size: "sm", variant: "subtle", onClick: () => setSelectedRecipient(null) }, /* @__PURE__ */ React249.createElement(IconX14, { size: 14 })))) : searchResults.length > 0 ? /* @__PURE__ */ React249.createElement(Paper17, { p: "xs", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React249.createElement(Stack157, { gap: 4 }, searchResults.map((result) => /* @__PURE__ */ React249.createElement(
|
|
26847
27238
|
Button41,
|
|
26848
27239
|
{
|
|
26849
27240
|
key: result.did,
|
|
@@ -26853,7 +27244,7 @@ var GrantPermissionModal = ({
|
|
|
26853
27244
|
onClick: () => setSelectedRecipient(result)
|
|
26854
27245
|
},
|
|
26855
27246
|
result.displayName
|
|
26856
|
-
)))) : null) : /* @__PURE__ */
|
|
27247
|
+
)))) : null) : /* @__PURE__ */ React249.createElement(
|
|
26857
27248
|
TextInput9,
|
|
26858
27249
|
{
|
|
26859
27250
|
label: "Recipient DID",
|
|
@@ -26861,12 +27252,12 @@ var GrantPermissionModal = ({
|
|
|
26861
27252
|
value: manualDid,
|
|
26862
27253
|
onChange: (e) => setManualDid(e.currentTarget.value)
|
|
26863
27254
|
}
|
|
26864
|
-
), /* @__PURE__ */
|
|
27255
|
+
), /* @__PURE__ */ React249.createElement(Divider22, null), /* @__PURE__ */ React249.createElement(Stack157, { gap: "xs" }, /* @__PURE__ */ React249.createElement(Text135, { size: "sm", fw: 500 }, "Permission Scope"), singleBlockMode && fixedBlock ? (
|
|
26865
27256
|
// Single block mode: show fixed block info
|
|
26866
|
-
/* @__PURE__ */
|
|
27257
|
+
/* @__PURE__ */ React249.createElement(Paper17, { p: "sm", withBorder: true }, /* @__PURE__ */ React249.createElement(Group90, { gap: "xs" }, /* @__PURE__ */ React249.createElement(Badge41, { variant: "light", color: "blue" }, fixedBlock.type), /* @__PURE__ */ React249.createElement(Text135, { size: "sm" }, fixedBlock.name || `Block ${fixedBlock.id.slice(-8)}`)), /* @__PURE__ */ React249.createElement(Text135, { size: "xs", c: "dimmed", mt: "xs" }, "Permission will be granted to execute this specific block."))
|
|
26867
27258
|
) : (
|
|
26868
27259
|
// Multi-block mode: show scope selection
|
|
26869
|
-
/* @__PURE__ */
|
|
27260
|
+
/* @__PURE__ */ React249.createElement(React249.Fragment, null, /* @__PURE__ */ React249.createElement(Radio6.Group, { value: scopeType, onChange: (v) => setScopeType(v) }, /* @__PURE__ */ React249.createElement(Stack157, { gap: "xs" }, /* @__PURE__ */ React249.createElement(Radio6, { value: "full", label: "Full flow access (can execute any block)" }), /* @__PURE__ */ React249.createElement(Radio6, { value: "blocks", label: "Specific blocks only" }))), scopeType === "blocks" && /* @__PURE__ */ React249.createElement(Paper17, { p: "sm", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React249.createElement(Stack157, { gap: "xs" }, blocks.map((block) => /* @__PURE__ */ React249.createElement(
|
|
26870
27261
|
Checkbox13,
|
|
26871
27262
|
{
|
|
26872
27263
|
key: block.id,
|
|
@@ -26881,14 +27272,14 @@ var GrantPermissionModal = ({
|
|
|
26881
27272
|
}
|
|
26882
27273
|
}
|
|
26883
27274
|
)))))
|
|
26884
|
-
)), /* @__PURE__ */
|
|
27275
|
+
)), /* @__PURE__ */ React249.createElement(Divider22, null), /* @__PURE__ */ React249.createElement(Stack157, { gap: "xs" }, /* @__PURE__ */ React249.createElement(
|
|
26885
27276
|
Checkbox13,
|
|
26886
27277
|
{
|
|
26887
27278
|
label: "Set expiration",
|
|
26888
27279
|
checked: expirationEnabled,
|
|
26889
27280
|
onChange: (e) => setExpirationEnabled(e.currentTarget.checked)
|
|
26890
27281
|
}
|
|
26891
|
-
), expirationEnabled && /* @__PURE__ */
|
|
27282
|
+
), expirationEnabled && /* @__PURE__ */ React249.createElement(
|
|
26892
27283
|
NumberInput3,
|
|
26893
27284
|
{
|
|
26894
27285
|
label: "Expires in (days)",
|
|
@@ -26898,7 +27289,7 @@ var GrantPermissionModal = ({
|
|
|
26898
27289
|
min: 1,
|
|
26899
27290
|
max: 365
|
|
26900
27291
|
}
|
|
26901
|
-
)), /* @__PURE__ */
|
|
27292
|
+
)), /* @__PURE__ */ React249.createElement(
|
|
26902
27293
|
Checkbox13,
|
|
26903
27294
|
{
|
|
26904
27295
|
label: "Recipient can grant permissions to others",
|
|
@@ -26906,7 +27297,7 @@ var GrantPermissionModal = ({
|
|
|
26906
27297
|
checked: canDelegate,
|
|
26907
27298
|
onChange: (e) => setCanDelegate(e.currentTarget.checked)
|
|
26908
27299
|
}
|
|
26909
|
-
), /* @__PURE__ */
|
|
27300
|
+
), /* @__PURE__ */ React249.createElement(Divider22, null), /* @__PURE__ */ React249.createElement(
|
|
26910
27301
|
TextInput9,
|
|
26911
27302
|
{
|
|
26912
27303
|
label: "Enter your PIN to sign this delegation",
|
|
@@ -26915,7 +27306,7 @@ var GrantPermissionModal = ({
|
|
|
26915
27306
|
value: pin,
|
|
26916
27307
|
onChange: (e) => setPin(e.currentTarget.value)
|
|
26917
27308
|
}
|
|
26918
|
-
), error && /* @__PURE__ */
|
|
27309
|
+
), error && /* @__PURE__ */ React249.createElement(Alert36, { color: "red" }, error), /* @__PURE__ */ React249.createElement(Group90, { justify: "flex-end" }, /* @__PURE__ */ React249.createElement(Button41, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React249.createElement(Button41, { onClick: handleGrant, loading }, "Grant Permission")))
|
|
26919
27310
|
);
|
|
26920
27311
|
};
|
|
26921
27312
|
|
|
@@ -27031,4 +27422,4 @@ export {
|
|
|
27031
27422
|
getExtraSlashMenuItems,
|
|
27032
27423
|
useCreateIxoEditor
|
|
27033
27424
|
};
|
|
27034
|
-
//# sourceMappingURL=chunk-
|
|
27425
|
+
//# sourceMappingURL=chunk-4TDDY3Q6.mjs.map
|