import { CardStack, CardStackContent, CardStackEntry, CardStackEntryContent, CardStackEntryDescription, CardStackEntryField, CardStackEntryTitle, } from "@executor-js/react/components/card-stack"; import { FreeformCombobox, type FreeformComboboxOption, } from "@executor-js/react/components/combobox"; import { Input } from "@executor-js/react/components/input"; import { Textarea } from "@executor-js/react/components/textarea"; import { IntegrationFavicon } from "@executor-js/react/components/integration-favicon"; import { IntegrationIdentityFieldRows, type IntegrationIdentity, } from "@executor-js/react/plugins/integration-identity"; /** The spec input is shown as a one-line "Spec URL" field only when it IS a * URL; pasted document content gets a multi-line editor instead. */ const isUrlInput = (value: string): boolean => URL.canParse(value.trim()); export function OpenApiSourceDetailsFields(props: { readonly title: string; readonly subtitle?: string; readonly identity: IntegrationIdentity; /** The integration's agent-visible description (prefilled from the spec). */ readonly description?: string; readonly onDescriptionChange?: (value: string) => void; readonly baseUrl: string; readonly onBaseUrlChange: (value: string) => void; readonly baseUrlOptions?: readonly FreeformComboboxOption[]; readonly baseUrlLabel?: string; readonly baseUrlPlaceholder?: string; readonly baseUrlHint?: string; readonly specUrl?: string; readonly onSpecUrlChange?: (value: string) => void; readonly faviconIcon?: string | null; readonly faviconUrl?: string; readonly namespaceReadOnly?: boolean; readonly specUrlDisabled?: boolean; readonly saveState?: "idle" | "saving" | "saved"; readonly baseUrlMissingMessage?: string; readonly footer?: string; }) { const specIsUrl = props.specUrl !== undefined && isUrlInput(props.specUrl); return ( {(props.faviconIcon || props.faviconUrl) && ( )} {props.title} {props.subtitle && ( {props.subtitle} )} {props.saveState && props.saveState !== "idle" && ( {props.saveState === "saving" ? "Saving…" : "Saved"} )} {props.onDescriptionChange && (