import React from "react"; import clsx from "clsx"; import { Spinner } from "@gland/react/spin"; import { icons } from "../icons"; import { richClasses as classes } from "../style"; import { editEvent } from "../editEvent"; export function InlineImage(props) { const ele = React.cloneElement(props.children[0], { custom: , }); return ele; } function Container(props) { props = props.props; return props.data.isRemote ? : ; } function RemoteImage(props) { props = props.props; const [URL, setURL] = React.useState(null); React.useEffect(() => { const getContentAsset = props.context.editor?.remote?.getContentAsset; if (getContentAsset) { getContentAsset(props.data, setURL, "InlineImage"); } else { setURL(""); } }, [props.data]); if (URL === null) { return (
); } return ; } function ImageContent(props) { const URL = props.URL; const { data, context, entityKey, children } = props.props; const { widthType, width } = data; let w = null; if (width) { if (widthType === "px") { w = width + "px"; } } return (
{ context.event.emit(editEvent.openEditImage, { key: entityKey, data, type: "inline" }); } } > {context.readOnly ? null : (
)}
); }