import Button from '@atlaskit/button/new';
import Heading from '@atlaskit/heading';
import Modal, { ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
import type { FunctionComponent } from 'react';
import React, { memo, useState } from 'react';
import { Element, Link } from 'react-scroll';
import type {
SerializedDocument,
SerializedEnumType,
SerializedObjectType,
SerializedScalar,
SerializedUnionType,
// We only import types here
// eslint-disable-next-line node/no-unpublished-import
} from '@atlassian/clientside-extensions-schema';
import useDiscovery from './debug/useDiscovery';
import { Blinker, BlinkerContainer, GRID_SIZE, HeadCell, HeadingWrapper, HeadRow, Table, TableCell, TableRow } from './styled';
export type ExtensionPointInfoProps = {
name: string;
schemaDocuments: { schema: SerializedDocument; contextSchema: SerializedDocument };
};
const LinkToElement = ({ to }: { to: string }) => {
// TODO: is there a way to get the clean type from the schema?
// We are removing the e.g. "!" required syntax that is a suffix of the schema type
const cleanTo = to.replace(/[^a-zA-Z0-9]/g, '');
return (
// eslint-disable-next-line jsx-a11y/anchor-is-valid, @typescript-eslint/ban-ts-comment
// @ts-ignore: react-scroll types are not up to date with the latest react version
{to}
);
};
const TypeRenderer: FunctionComponent<{ objectType: SerializedObjectType }> = ({ objectType }) => (
<>
>
);
const EnumTypeRenderer = ({ enumType }: { enumType: SerializedEnumType }) => (
<>
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
{/* @ts-ignore: react-scroll types are not up to date with the latest react version*/}
{enumType.name}
{enumType.description ? (
{enumType.description}
) : (
Enum type with the following values: {enumType.values.join(', ')}
)}
>
);
const UnionTypeRenderer = ({ unionType }: { unionType: SerializedUnionType }) => (
<>
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
{/* @ts-ignore: react-scroll types are not up to date with the latest react version*/}
{unionType.name}
{unionType.description ? (
{unionType.description}
) : (
Union of the following types:{' '}
{unionType.types.map((_type, i) => (
{i === 0 ? '' : ', '}
))}
)}
>
);
const ScalarRenderer = ({ scalar }: { scalar: SerializedScalar }) => (
<>
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
{/* @ts-ignore: react-scroll types are not up to date with the latest react version*/}
{scalar.name}