@mintlify/msft-sdk 1.1.25 → 1.1.27
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/api-playground/ApiPlayground/ApiPlaygroundContext.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/BodySection.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/ParameterSection.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/SecuritySection.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/ServerSection.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/index.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/CopyFileToClipboardButton.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/DownloadFileButton.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/index.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponseError.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponseHeaders.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponseTable.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/index.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/ArrayCount.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/InputContainer.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/ObjectExpandButton.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/PathHeader.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/TrashButton.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/TypeDropdown.js.map +1 -1
- package/dist/api-playground/ApiPlayground/index.js.map +1 -1
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js.map +1 -1
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js.map +1 -1
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js.map +1 -1
- package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js.map +1 -1
- package/dist/api-playground/EndpointFields/components/Description.js.map +1 -1
- package/dist/api-playground/EndpointFields/components/OneOfDropdown.js.map +1 -1
- package/dist/api-playground/EndpointFields/components/OptionDropdown.js.map +1 -1
- package/dist/api-playground/EndpointFields/components/SectionHeading.js.map +1 -1
- package/dist/api-playground/EndpointFields/index.js.map +1 -1
- package/dist/api-playground-2/Api.js.map +1 -1
- package/dist/api-playground-2/ApiExamples.js.map +1 -1
- package/dist/api-playground-2/ApiFields.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/fields/NumberMetadata.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/fields/StringMetadata.js.map +1 -1
- package/dist/api-playground-2/components/Example/RequestExample.js +17 -15
- package/dist/api-playground-2/components/Example/RequestExample.js.map +1 -1
- package/dist/api-playground-2/components/Example/ResponseExample.js.map +1 -1
- package/dist/api-playground-2/components/Request/InputSectionContainer.js.map +1 -1
- package/dist/api-playground-2/components/TypeDropdown.js.map +1 -1
- package/dist/api-playground-2/contexts/ApiPlaygroundContext.js.map +1 -1
- package/dist/api-playground-2/generators/generateInteractiveCodeSample.js +10 -10
- package/dist/api-playground-2/generators/generateInteractiveCodeSample.js.map +1 -1
- package/dist/api-playground-2/generators/generateSnippetMap.js +24 -24
- package/dist/api-playground-2/generators/generateSnippetMap.js.map +1 -1
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js.map +1 -1
- package/dist/components/Api/ErrorBoundary.js.map +1 -1
- package/dist/components/Api/Expandable.js.map +1 -1
- package/dist/components/Api/Markdown.js.map +1 -1
- package/dist/components/Api/MethodPill.js.map +1 -1
- package/dist/components/Api/Param.js.map +1 -1
- package/dist/components/Api/colors.js.map +1 -1
- package/dist/components/content-components/CodeGroupSelect/CodeGroupCopyButton.js.map +1 -1
- package/dist/components/content-components/CodeGroupSelect/CodeSelectDropdown.js.map +1 -1
- package/dist/components/content-components/CodeGroupSelect/index.js.map +1 -1
- package/dist/components/content-components/code-block.js.map +1 -1
- package/dist/components/content-components/code-group.js.map +1 -1
- package/dist/components/content-components/code-snippet.js.map +1 -1
- package/dist/components/content-components/code-snippets.js.map +1 -1
- package/dist/components/content-components/getNodeText.js.map +1 -1
- package/dist/components/docsLayout.js +29 -27
- package/dist/components/docsLayout.js.map +1 -1
- package/dist/components/nav-tree/index.js +174 -178
- package/dist/components/nav-tree/index.js.map +1 -1
- package/dist/contexts/CodeExampleLabelContext.js.map +1 -1
- package/dist/contexts/ConfigContext.js.map +1 -1
- package/dist/contexts/EndpointLocationContext.js.map +1 -1
- package/dist/contexts/MDXContentContext.js.map +1 -1
- package/dist/hooks/useApiPlaygroundDisplay.js.map +1 -1
- package/dist/hooks/useApiPlaygroundInputs.js.map +1 -1
- package/dist/hooks/useBaseUrlOptions.js.map +1 -1
- package/dist/hooks/useEndpoint.js.map +1 -1
- package/dist/hooks/useKeyboardShortcut.js.map +1 -1
- package/dist/hooks/useMDXContent.js.map +1 -1
- package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js.map +1 -1
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js.map +1 -1
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js.map +1 -1
- package/dist/hooks/usePlaygroundSchemaOptions.js.map +1 -1
- package/dist/hooks/usePrefilledInputs/index.js.map +1 -1
- package/dist/hooks/usePrefilledInputs/storedServerVariables.js.map +1 -1
- package/dist/hooks/useSecurityOption.js.map +1 -1
- package/dist/hooks/useSendPlaygroundRequest.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseTopbar.js","sources":["../../../../src/api-playground/ApiPlayground/Response/ResponseTopbar.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ResponseTopbar.js","sources":["../../../../src/api-playground/ApiPlayground/Response/ResponseTopbar.tsx"],"sourcesContent":["\nimport { ApiPlaygroundResultType } from '@mintlify/models';\n\nimport { useSelectedLocale } from '@/utils/locales';\nimport { CheckmarkCircleRegular, ErrorCircleRegular, DismissCircleRegular, WarningRegular } from '@fluentui/react-icons';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\nimport { ChevronDownFilled } from '@fluentui/react-icons';\nimport { ResponseBodyData, ResponseSection, responseSections } from '.';\nimport { CopyFileToClipboardButton } from './CopyFileToClipboardButton';\nimport { DownloadButton } from './DownloadFileButton';\n\ntype ResponseHeaderParams = {\n result: ApiPlaygroundResultType;\n selectedSection: ResponseSection;\n setSelectedSection: (value: ResponseSection) => void;\n data: ResponseBodyData | undefined;\n};\n\nexport const ResponseTopbar = ({\n result,\n selectedSection,\n setSelectedSection,\n data,\n}: ResponseHeaderParams) => {\n return (\n <div className=\"mint:flex mint:w-full mint:px-2 mint:py-1 mint:space-x-3 mint:items-center mint:rounded-t-2xl\">\n <div className=\"mint:flex mint:flex-1 mint:space-x-4 mint:items-center\">\n <StatusInfo\n status={!result.error ? result.response.status : undefined}\n statusText={!result.error ? result.response.statusText : undefined}\n />\n </div>\n {data ? (\n <>\n <ResponseSectionDropdown\n selectedSection={selectedSection}\n setSelectedSection={setSelectedSection}\n />\n <DownloadButton data={data} />\n <CopyFileToClipboardButton data={data} />\n </>\n ) : null}\n </div>\n );\n};\n\nconst StatusInfo = ({ status, statusText }: { status?: number; statusText?: string }) => {\n\n return (\n <div className=\"mint:flex mint:space-x-2 mint:items-center\">\n <StatusIcon status={status} />\n <div\n className={cn(\n 'mint:text-xs',\n 'mint:text-gray-800 mint:dark:text-gray-200 mint:font-medium'\n )}\n >\n {status ? `${status} - ${statusText}` : '--'}\n </div>\n </div>\n );\n};\n\nconst StatusIcon = ({ status }: { status: number | undefined }) => {\n const commonClassName = 'w-3.5 h-3.5';\n\n if (status === undefined) {\n // response not completed\n return (\n <WarningRegular\n className={cn(commonClassName, 'mint:bg-red-600 mint:dark:bg-red-500')}\n />\n );\n } else if (status >= 400) {\n // error\n return <ErrorCircleRegular className={cn(commonClassName, 'mint:bg-red-600 mint:dark:bg-red-500')} />;\n } else if (status >= 200 && status < 300) {\n // success\n return (\n <CheckmarkCircleRegular className={cn(commonClassName, 'mint:bg-green-600 mint:dark:bg-green-500')} />\n );\n } else {\n // weird status code\n return (\n <ErrorCircleRegular\n className={cn(commonClassName, 'mint:bg-orange-600 mint:dark:bg-orange-500')}\n />\n );\n }\n};\n\ntype ResponseSectionDropdownParams = {\n selectedSection: ResponseSection;\n setSelectedSection: (value: ResponseSection) => void;\n};\n\nconst ResponseSectionDropdown = ({\n selectedSection,\n setSelectedSection,\n}: ResponseSectionDropdownParams) => {\n const locale = useSelectedLocale();\n\n return (\n <div className=\"mint:relative\">\n <select\n aria-label={locale['aria.selectResponseSection']}\n className={cn(\n 'mint:pl-2.5 mint:pr-6 mint:py-1 mint:rounded-lg mint:text-xs mint:font-medium mint:border mint:cursor-pointer mint:focus:outline-0',\n 'mint:text-gray-600 mint:dark:text-gray-400 mint:border-standard mint:hover:bg-gray-50 mint:dark:hover:bg-white/[0.03]'\n )}\n value={selectedSection}\n \n onChange={(event) => setSelectedSection(event.target.value as ResponseSection)}\n >\n {responseSections.map((option) => (\n <option value={option} key={option}>\n {(option[0]?.toUpperCase() ?? '') + option.slice(1)}\n </option>\n ))}\n </select>\n <div className=\"mint:pointer-events-none mint:absolute mint:inset-0 mint:flex mint:items-center mint:justify-end mint:pr-2.5\">\n <ChevronDownFilled\n className={cn(\n 'mint:h-2.5 mint:w-2.5 mint:text-gray-500 mint:dark:text-gray-400 mint:shrink-0'\n )}\n />\n </div>\n </div>\n );\n};\n"],"names":["ResponseTopbar","result","selectedSection","setSelectedSection","data","jsxs","jsx","StatusInfo","Fragment","ResponseSectionDropdown","DownloadButton","CopyFileToClipboardButton","status","statusText","StatusIcon","cn","commonClassName","WarningRegular","ErrorCircleRegular","CheckmarkCircleRegular","locale","useSelectedLocale","event","option","_a","ChevronDownFilled"],"mappings":";;;;;;;;AAkBO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,QAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,MAAAC;AACF,MAEI,gBAAAC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0C,GAAG,IAKpG,gBAAAV;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,WAAWH,EAAGC,GAAiB,4CAA4C;AAAA,IAAA;AAAA,EAAA;AAInF,GAOMP,IAA0B,CAAC;AAAA,EAC/B,iBAAAP;AAAA,EACA,oBAAAC;AACF,MAAqC;AACnC,QAAMiB,IAASC,EAAA;AAEf,SACE,gBAAAhB,EAAC,OAAA,EAAI,WAAU,iBACb,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,cAAYc,EAAO,4BAA4B;AAAA,QAC/C,WAAWL;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAEF,OAAOb;AAAA,QAEP,UAAU,CAACoB,MAAUnB,EAAmBmB,EAAM,OAAO,KAAwB;AAAA,QAE5E,YAAiB,IAAI,CAACC;;AACrB,iCAAAjB,EAAC,UAAA,EAAO,OAAOiB,GACX,aAAAC,IAAAD,EAAO,CAAC,MAAR,gBAAAC,EAAW,kBAAiB,MAAMD,EAAO,MAAM,CAAC,EAAA,GADxBA,CAE5B;AAAA,SACD;AAAA,MAAA;AAAA,IAAA;AAAA,IAEH,gBAAAjB,EAAC,OAAA,EAAI,WAAU,gHACb,UAAA,gBAAAA;AAAA,MAACmB;AAAA,MAAA;AAAA,QACC,WAAWV;AAAA,UACT;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,EACF,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/api-playground/ApiPlayground/Response/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/api-playground/ApiPlayground/Response/index.tsx"],"sourcesContent":["\nimport { ApiPlaygroundResultType } from '@mintlify/models';\nimport { extension as extensionLookup } from 'mime-types';\nimport { useMemo, useState } from 'react';\n\nimport ErrorBoundary from '@/components/Api/ErrorBoundary';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { ResponseBody } from './ResponseBody';\nimport { ResponseError } from './ResponseError';\nimport { ResponseHeaders } from './ResponseHeaders';\nimport { ResponseTopbar } from './ResponseTopbar';\n\nexport const responseSections = ['body', 'headers'] as const;\nexport type ResponseSection = (typeof responseSections)[number];\n\nexport const Response = ({\n result,\n className,\n}: {\n result: ApiPlaygroundResultType;\n className: string;\n}) => {\n const [responseSection, setResponseSection] = useState<ResponseSection>('body');\n\n // TODO: perform this parsing upon request completion\n const responseBodyData = useResponseBodyData(result);\n\n const Content = () => (\n <div\n className={cn(\n 'mint:rounded-xt mint:dark:bg-zinc-950 mint:bg-white',\n )}\n >\n {result.error ? (\n <ResponseError message={result.errorMessage} />\n ) : responseSection === 'body' ? (\n <ResponseBody data={responseBodyData} />\n ) : (\n <ResponseHeaders response={result.response} />\n )}\n </div>\n );\n\n return (\n <ErrorBoundary>\n <div\n className={cn(\n 'mint:w-full mint:rounded-2xl mint:border mint:p-0.5',\n 'mint:bg-gray-50 mint:dark:bg-white/5 mint:border-gray-950/10 mint:dark:border-white/10',\n className\n )}\n >\n <ResponseTopbar\n selectedSection={responseSection}\n setSelectedSection={setResponseSection}\n result={result}\n data={responseBodyData}\n />\n <Content />\n </div>\n </ErrorBoundary>\n );\n};\n\nconst useResponseBodyData = (result: ApiPlaygroundResultType): ResponseBodyData | undefined => {\n return useMemo(() => {\n if (result.error || result.response.data == undefined) {\n return undefined;\n }\n\n const buffer = Buffer.from(result.response.data, 'base64');\n const contentType = parseContentTypeFromHeaders(result.response.headers);\n const mediaCategory = contentTypeToMediaCategory(contentType);\n const blob = new Blob([buffer], { type: contentType });\n const url = URL.createObjectURL(blob);\n const extension = contentType ? extensionLookup(contentType) || undefined : undefined;\n\n if (contentType && mediaCategory !== 'other') {\n return {\n type: mediaCategory,\n contentType,\n blob,\n url,\n extension,\n };\n }\n\n return {\n type: 'other',\n contentType,\n content: buffer.toString('utf-8'),\n blob,\n url,\n extension,\n };\n }, [result]);\n};\n\nexport type ResponseBodyData =\n | ImageResponseData\n | AudioResponseData\n | VideoResponseData\n | OtherResponseData;\n\ntype BaseResponseData = {\n blob: Blob;\n url: string;\n extension?: string;\n};\n\nexport type ImageResponseData = BaseResponseData & {\n type: 'image';\n contentType: string;\n};\n\nexport type AudioResponseData = BaseResponseData & {\n type: 'audio';\n contentType: string;\n};\n\nexport type VideoResponseData = BaseResponseData & {\n type: 'video';\n contentType: string;\n};\n\nexport type OtherResponseData = BaseResponseData & {\n type: 'other';\n contentType?: string;\n content: string;\n};\n\ntype MediaCategory = ResponseBodyData['type'];\n\nconst parseContentTypeFromHeaders = (headers: Record<string, unknown>) => {\n for (const headerName in headers) {\n if (headerName.toLowerCase() === 'content-type') {\n const contentType = headers[headerName];\n if (typeof contentType === 'string') {\n return contentType.split(';')[0]?.toLowerCase();\n }\n }\n }\n};\n\nconst contentTypeToMediaCategory = (contentType: string | undefined): MediaCategory => {\n const [typeCategory] = contentType?.split('/') ?? [];\n if (typeCategory === 'image' || typeCategory === 'audio' || typeCategory === 'video') {\n return typeCategory;\n }\n\n return 'other';\n};\n"],"names":["responseSections","Response","result","className","responseSection","setResponseSection","useState","responseBodyData","useResponseBodyData","Content","jsx","cn","ResponseError","ResponseBody","ResponseHeaders","ErrorBoundary","jsxs","ResponseTopbar","useMemo","buffer","contentType","parseContentTypeFromHeaders","mediaCategory","contentTypeToMediaCategory","blob","url","extension","extensionLookup","headers","headerName","_a","typeCategory"],"mappings":";;;;;;;;;;AAaO,MAAMA,IAAmB,CAAC,QAAQ,SAAS,GAGrCC,IAAW,CAAC;AAAA,EACvB,QAAAC;AAAA,EACA,WAAAC;AACF,MAGM;AACJ,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAA0B,MAAM,GAGxEC,IAAmBC,EAAoBN,CAAM,GAE7CO,IAAU,MACd,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,MAAA;AAAA,MAGD,YAAO,QACN,gBAAAD,EAAC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mB,IAA8B,CAACO,MAAqC;;AACxE,aAAWC,KAAcD;AACvB,QAAIC,EAAW,YAAA,MAAkB,gBAAgB;AAC/C,YAAMT,IAAcQ,EAAQC,CAAU;AACtC,UAAI,OAAOT,KAAgB;AACzB,gBAAOU,IAAAV,EAAY,MAAM,GAAG,EAAE,CAAC,MAAxB,gBAAAU,EAA2B;AAAA,IAEtC;AAEJ,GAEMP,IAA6B,CAACH,MAAmD;AACrF,QAAM,CAACW,CAAY,KAAIX,KAAA,gBAAAA,EAAa,MAAM,SAAQ,CAAA;AAClD,SAAIW,MAAiB,WAAWA,MAAiB,WAAWA,MAAiB,UACpEA,IAGF;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdditionalPropertyButton.js","sources":["../../../../src/api-playground/ApiPlayground/components/AdditionalPropertyButton.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"AdditionalPropertyButton.js","sources":["../../../../src/api-playground/ApiPlayground/components/AdditionalPropertyButton.tsx"],"sourcesContent":["\nimport { useState } from 'react';\n\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { AddAdditionalItemButton } from '../Request/inputs/ArrayInput';\n\ntype AdditionalPropertyButtonParams = {\n onAddKey: (name: string) => void;\n existingKeys: string[];\n dataTestId?: string;\n};\n\nexport const AdditionalPropertyButton = ({\n onAddKey,\n existingKeys,\n dataTestId,\n}: AdditionalPropertyButtonParams) => {\n const [isActive, setIsActive] = useState(false);\n const [key, setKey] = useState('');\n\n const isDuplicate = existingKeys.includes(key);\n const isValid = key.length > 0 && !isDuplicate;\n\n if (!isActive) {\n return (\n <AddAdditionalItemButton\n className=\"mint:py-5\"\n onClick={() => setIsActive((prev) => !prev)}\n label=\"Add new property\"\n dataTestId={dataTestId}\n />\n );\n }\n\n return (\n <input\n className={cn(\n 'mint:py-6 mint:flex-1 mint:bg-transparent mint:outline-0 mint:text-sm mint:text-gray-900 mint:dark:text-gray-100 mint:placeholder-gray-300 mint:dark:placeholder-white/30 mint:font-mono mint:font-medium',\n isDuplicate ? 'mint:underline mint:decoration-wavy mint:decoration-red-400' : ''\n )}\n placeholder=\"Enter key of new property\"\n type=\"text\"\n autoFocus\n value={key}\n onBlur={() => {\n setKey('');\n setIsActive(false);\n }}\n onChange={(event) => setKey(event.target.value)}\n onKeyDown={(event) => {\n if ((event.key === 'Enter' || event.key === 'Tab') && isValid) {\n onAddKey(event.currentTarget.value);\n }\n }}\n spellCheck={false}\n />\n );\n};\n"],"names":["AdditionalPropertyButton","onAddKey","existingKeys","dataTestId","isActive","setIsActive","useState","key","setKey","isDuplicate","isValid","jsx","cn","event","AddAdditionalItemButton","prev"],"mappings":";;;;;AAaO,MAAMA,IAA2B,CAAC;AAAA,EACvC,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AACF,MAAsC;AACpC,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAK,GACxC,CAACC,GAAKC,CAAM,IAAIF,EAAS,EAAE,GAE3BG,IAAcP,EAAa,SAASK,CAAG,GACvCG,IAAUH,EAAI,SAAS,KAAK,CAACE;AAEnC,SAAKL,IAYH,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAH,IAAc,gEAAgE;AAAA,MAAA;AAAA,MAEhF,aAAY;AAAA,MACZ,MAAK;AAAA,MACL,WAAS;AAAA,MACT,OAAOF;AAAA,MACP,QAAQ,MAAM;AACZ,QAAAC,EAAO,EAAE,GACTH,EAAY,EAAK;AAAA,MACnB;AAAA,MACA,UAAU,CAACQ,MAAUL,EAAOK,EAAM,OAAO,KAAK;AAAA,MAC9C,WAAW,CAACA,MAAU;AACpB,SAAKA,EAAM,QAAQ,WAAWA,EAAM,QAAQ,UAAUH,KACpDT,EAASY,EAAM,cAAc,KAAK;AAAA,MAEtC;AAAA,MACA,YAAY;AAAA,IAAA;AAAA,EAAA,IA7BZ,gBAAAF;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,SAAS,MAAMT,EAAY,CAACU,MAAS,CAACA,CAAI;AAAA,MAC1C,OAAM;AAAA,MACN,YAAAZ;AAAA,IAAA;AAAA,EAAA;AA4BR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayCount.js","sources":["../../../../src/api-playground/ApiPlayground/components/ArrayCount.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ArrayCount.js","sources":["../../../../src/api-playground/ApiPlayground/components/ArrayCount.tsx"],"sourcesContent":["\nimport { ReactNode } from 'react';\n\nimport { cn } from '@/utils/cn';\n\nexport function ArrayCount({ children, className }: { children: ReactNode; className?: string }) {\n return (\n <div\n className={cn(\n 'mint:rounded-full mint:h-5 mint:w-5 mint:flex mint:items-center mint:justify-center mint:bg-gray-50 mint:dark:bg-white/10 mint:text-xs mint:font-sans mint:font-medium mint:text-gray-600 mint:dark:text-gray-300',\n className\n )}\n >\n {children}\n </div>\n );\n}\n"],"names":["ArrayCount","children","className","jsx","cn"],"mappings":";;AAKO,SAASA,EAAW,EAAE,UAAAC,GAAU,WAAAC,KAA0D;AAC/F,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAF;AAAA,MAAA;AAAA,MAGD,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EndpointsMenuLink.js","sources":["../../../../src/api-playground/ApiPlayground/components/EndpointsMenuLink.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"EndpointsMenuLink.js","sources":["../../../../src/api-playground/ApiPlayground/components/EndpointsMenuLink.tsx"],"sourcesContent":["\nimport { MethodPill } from '../../../components/Api/MethodPill';\nimport { ApiPageData } from '../../../api-playground-2/types/api';\nimport { isEqualIgnoringLeadingSlash } from '../../../../src/paths/isEqualIgnoringLeadingSlash';\nimport { cn } from '@/utils/cn';\n\nexport const EndpointsMenuLink = ({ page, pathname }: { page: ApiPageData; pathname: string }) => {\n const isActive = isEqualIgnoringLeadingSlash(page.href, pathname);\n const shortMethod = page.type === 'openapi';\n const noPlayground =\n page.playground === 'none' || page.playground === 'simple' || page.method === 'webhook';\n\n const handleClick = (e: React.MouseEvent) => {\n e.preventDefault();\n const targetHref = noPlayground ? page.href : `${page.href}?playground=open`;\n\n // Check if we're in a Next.js environment\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (typeof window !== 'undefined' && (window as any).next) {\n // Use Next.js router if available\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const router = (window as any).next.router;\n if (router) {\n router.push(targetHref);\n return;\n }\n }\n\n // Fallback to standard navigation\n window.location.href = targetHref;\n };\n\n return (\n <a href={page.href} title={page.title}>\n <div\n onClick={handleClick}\n className={cn(\n 'mint:flex mint:items-center mint:gap-x-2 mint:hover:bg-gray-50 mint:dark:hover:bg-white/5 mint:rounded-xl mint:p-1.5 mint:group mint:cursor-pointer',\n isActive\n ? 'mint:bg-gray-50 mint:dark:bg-white/5 mint:text-[#643FB2] mint:dark:text-[#C9AAF9] mint:font-medium'\n : 'mint:text-gray-700 mint:hover:text-gray-900 mint:dark:text-gray-400 mint:dark:hover:text-gray-300'\n )}\n >\n <MethodPill\n method={page.method}\n shortMethod={shortMethod}\n className=\"mint:font-medium mint:px-1 mint:py-px mint:text-xs mint:rounded-md\"\n isActive={isActive}\n />\n <div className=\"mint:text-sm mint:truncate\">{page.title}</div>\n </div>\n </a>\n );\n};\n"],"names":["EndpointsMenuLink","page","pathname","isActive","isEqualIgnoringLeadingSlash","shortMethod","noPlayground","handleClick","e","targetHref","router","jsxs","cn","jsx","MethodPill"],"mappings":";;;;AAMO,MAAMA,IAAoB,CAAC,EAAE,MAAAC,GAAM,UAAAC,QAAwD;AAChG,QAAMC,IAAWC,EAA4BH,EAAK,MAAMC,CAAQ,GAC1DG,IAAcJ,EAAK,SAAS,WAC5BK,IACJL,EAAK,eAAe,UAAUA,EAAK,eAAe,YAAYA,EAAK,WAAW,WAE1EM,IAAc,CAACC,MAAwB;AAC3C,IAAAA,EAAE,eAAA;AACF,UAAMC,IAAaH,IAAeL,EAAK,OAAO,GAAGA,EAAK,IAAI;AAI1D,QAAI,OAAO,SAAW,OAAgB,OAAe,MAAM;AAGzD,YAAMS,IAAU,OAAe,KAAK;AACpC,UAAIA,GAAQ;AACV,QAAAA,EAAO,KAAKD,CAAU;AACtB;AAAA,MACF;AAAA,IACF;AAGA,WAAO,SAAS,OAAOA;AAAA,EACzB;AAEA,2BACG,KAAA,EAAE,MAAMR,EAAK,MAAM,OAAOA,EAAK,OAC9B,UAAA,gBAAAU;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAASJ;AAAA,MACT,WAAWK;AAAA,QACT;AAAA,QACAT,IACI,uGACA;AAAA,MAAA;AAAA,MAGN,UAAA;AAAA,QAAA,gBAAAU;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,QAAQb,EAAK;AAAA,YACb,aAAAI;AAAA,YACA,WAAU;AAAA,YACV,UAAAF;AAAA,UAAA;AAAA,QAAA;AAAA,QAEF,gBAAAU,EAAC,OAAA,EAAI,WAAU,8BAA8B,YAAK,MAAA,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAE5D;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputContainer.js","sources":["../../../../src/api-playground/ApiPlayground/components/InputContainer.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"InputContainer.js","sources":["../../../../src/api-playground/ApiPlayground/components/InputContainer.tsx"],"sourcesContent":["\nimport { DataSchema, IncrementalDataSchema } from '@mintlify/validation';\nimport { ReactNode, useState } from 'react';\n\nimport { isEnum } from '@/api-playground/EndpointFields/ParamFields/PrimitiveParamField';\nimport { Description } from '@/api-playground/EndpointFields/components/Description';\nimport { DeprecatedPill, InfoPill, RequiredPill } from '../../../components/Api/Param';\nimport ErrorBoundary from '../../../components/Api/ErrorBoundary';\nimport { containsMarkdownTable } from '@/utils/containsMarkdownTable';\nimport { cn } from '@/utils/cn';\n\nimport { ArrayCount } from './ArrayCount';\nimport { ObjectExpandButton } from './ObjectExpandButton';\nimport { TrashButton } from './TrashButton';\n\ntype InputContainerParams = {\n name?: string;\n typeDropdown: ReactNode;\n schema: DataSchema | IncrementalDataSchema;\n children?: ReactNode;\n onClear: (() => void) | undefined;\n isObject?: boolean;\n isArray?: boolean;\n parentNames?: string[];\n arrayIndex?: number;\n defaultExpanded?: boolean;\n style?: string;\n explode?: boolean;\n};\n\nexport const InputContainer = ({\n name,\n children,\n schema,\n onClear,\n isObject,\n isArray,\n parentNames,\n arrayIndex,\n typeDropdown,\n defaultExpanded = true,\n style,\n explode,\n}: InputContainerParams) => {\n const [showChildren, setShowChildren] = useState(defaultExpanded);\n const propertiesCount = schema.type === 'object' ? Object.keys(schema.properties).length : 0;\n\n const typeLabel =\n 'format' in schema && typeof schema.format === 'string'\n ? `${schema.type}<${schema.format}>`\n : schema.type;\n\n const descriptionContainsTable =\n isEnum(schema) && schema.description && containsMarkdownTable(schema.description);\n\n return (\n <ErrorBoundary>\n <div\n className={cn(\n 'mint:flex mint:space-x-3 mint:items-start',\n arrayIndex != undefined && !isObject && 'mint:flex mint:items-center'\n )}\n >\n {arrayIndex != undefined && (\n <ArrayCount className={cn(isObject && 'mint:mt-8')}>{arrayIndex + 1}</ArrayCount>\n )}\n <div\n className={cn(\n 'mint:flex-1 mint:grid mint:lg:grid-cols-2 mint:gap-x-12 mint:gap-y-4 mint:py-5 mint:max-w-full',\n isArray && 'mint:flex mint:flex-col',\n isObject &&\n 'mint:gap-y-0 mint:flex mint:flex-col mint:border mint:border-gray-50 mint:dark:border-white/5 mint:rounded-xl mint:px-4 mint:py-0 mint:my-5',\n arrayIndex !== undefined && 'mint:py-1 mint:my-2'\n )}\n >\n <div\n className={cn(\n 'mint:space-y-2',\n isObject && 'mint:pt-8 mint:py-5 mint:border-b mint:border-gray-50 mint:dark:border-white/5',\n !showChildren && 'mint:border-none',\n arrayIndex != undefined && !isObject && 'mint:flex mint:items-center'\n )}\n >\n <div className=\"mint:flex mint:items-center mint:justify-between mint:font-mono mint:font-bold\">\n <div\n className=\"mint:flex mint:flex-wrap mint:items-center mint:gap-2 mint:text-xs mint:truncate\"\n title={parentNames ? `${parentNames.join('.')}.${name}` : name}\n >\n <div className={cn('mint:text-sm mint:truncate', name == undefined && 'mint:hidden')}>\n {parentNames && parentNames.length > 0 && style === 'deepObject' && explode ? (\n <>\n <span className=\"mint:text-gray-500 mint:dark:text-gray-400\">\n {parentNames.map((parentName, index) => (\n <>\n {parentName}\n {index === 0 ? '[' : ']['}\n </>\n ))}\n </span>\n <span className=\"mint:font-semibold mint:text-gray-900 mint:dark:text-gray-100\">{name}</span>\n <span className=\"mint:text-gray-500 mint:dark:text-gray-400\">{']'}</span>\n </>\n ) : (\n <>\n <span className=\"mint:text-gray-500 mint:dark:text-gray-400\">\n {parentNames ? `${parentNames.join('.')}.` : ''}\n </span>\n <span className=\"mint:font-semibold mint:text-gray-900 mint:dark:text-gray-100\">{name}</span>\n </>\n )}\n </div>\n {typeDropdown != undefined ? typeDropdown : <InfoPill>{typeLabel}</InfoPill>}\n {schema.required && <RequiredPill />}\n {schema.deprecated && <DeprecatedPill />}\n </div>\n {isObject && (\n <ObjectExpandButton\n onClick={() => setShowChildren(!showChildren)}\n count={propertiesCount}\n labeled={defaultExpanded == false}\n />\n )}\n </div>\n {schema.description && !descriptionContainsTable && (\n <Description\n markdown={schema.description}\n className=\"mint:text-gray-500 mint:dark:text-gray-400\"\n />\n )}\n </div>\n {showChildren && (\n <div\n className={cn(\n 'mint:grid mint:grid-cols-1 mint:w-full mint:items-start mint:divide-y mint:divide-gray-50 mint:dark:divide-white/5',\n isArray && 'mint:divide-y-0'\n )}\n >\n {children}\n </div>\n )}\n </div>\n {(arrayIndex != undefined || parentNames) && onClear && (\n <TrashButton\n className={cn(isObject && 'mint:mt-8', parentNames && 'mint:mt-7')}\n onClick={() => onClear()}\n />\n )}\n </div>\n {schema.description && descriptionContainsTable && (\n <Description markdown={schema.description} className=\"mint:text-gray-500 mint:dark:text-gray-400\" />\n )}\n </ErrorBoundary>\n );\n};\n"],"names":["InputContainer","name","children","schema","onClear","isObject","isArray","parentNames","arrayIndex","typeDropdown","defaultExpanded","style","explode","showChildren","setShowChildren","useState","propertiesCount","typeLabel","descriptionContainsTable","isEnum","containsMarkdownTable","ErrorBoundary","jsxs","cn","ArrayCount","jsx","Fragment","parentName","index","InfoPill","RequiredPill","DeprecatedPill","ObjectExpandButton","Description","TrashButton"],"mappings":";;;;;;;;;;;AA8BO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,OAAAC;AAAA,EACA,SAAAC;AACF,MAA4B;AAC1B,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAASL,CAAe,GAC1DM,IAAkBb,EAAO,SAAS,WAAW,OAAO,KAAKA,EAAO,UAAU,EAAE,SAAS,GAErFc,IACJ,YAAYd,KAAU,OAAOA,EAAO,UAAW,WAC3C,GAAGA,EAAO,IAAI,IAAIA,EAAO,MAAM,MAC/BA,EAAO,MAEPe,IACJC,EAAOhB,CAAM,KAAKA,EAAO,eAAeiB,EAAsBjB,EAAO,WAAW;AAElF,2BACGkB,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC;AAAA,UACT;AAAA,UACAf,KAAc,QAAa,CAACH,KAAY;AAAA,QAAA;AAAA,QAGzC,UAAA;AAAA,UAAAG,KAAc,0BACZgB,GAAA,EAAW,WAAWD,EAAGlB,KAAY,WAAW,GAAI,UA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AA;AAAA,IAGHD,EAAO,eAAee,KACrB,gBAAAO,EAACQ,KAAY,UAAU9B,EAAO,aAAa,WAAU,6CAAA,CAA6C;AAAA,EAAA,GAEtG;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputSectionContainer.js","sources":["../../../../src/api-playground/ApiPlayground/components/InputSectionContainer.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"InputSectionContainer.js","sources":["../../../../src/api-playground/ApiPlayground/components/InputSectionContainer.tsx"],"sourcesContent":["\nimport { ReactNode, useState } from 'react';\n\nimport { CheckmarkCircleRegular, ErrorCircleRegular } from '@fluentui/react-icons';\nimport { ChevronRightFilled } from '@fluentui/react-icons';\nimport { cn } from \"../../../utils/cn\";\n\ntype InputSectionContainerParams = {\n name: string;\n validationState?: 'valid' | 'invalid';\n children?: ReactNode;\n rightElement?: ReactNode;\n};\n\nexport const InputSectionContainer = ({\n name,\n validationState,\n children,\n rightElement,\n}: InputSectionContainerParams) => {\n const [expanded, setExpanded] = useState(true);\n\n return (\n <div>\n <button\n aria-label=\"Expand Input Section\"\n onClick={() => setExpanded((prev) => !prev)}\n className={cn(\n 'mint:flex mint:w-full mint:px-4 mint:py-2.5 mint:items-center mint:justify-between mint:border-standard mint:cursor-pointer mint:hover:bg-gray-50 mint:dark:hover:bg-white/5',\n expanded ? 'mint:border-b-0! mint:border-t mint:border-x mint:rounded-t-2xl' : 'mint:rounded-2xl'\n )}\n >\n <div className=\"mint:flex mint:items-center mint:gap-x-1.5\">\n <ChevronRightFilled\n className={cn(\n 'mint:h-3 mint:w-3 mint:bg-gray-400 mint:dark:bg-gray-500 mint:transition-transform',\n expanded && 'mint:rotate-180'\n )}\n />\n <div className=\"mint:flex-1 mint:flex mint:items-center mint:space-x-2\">\n <div className=\"mint:text-sm mint:font-medium mint:text-gray-800 mint:dark:text-gray-200 mint:leading-6\">\n {name}\n </div>\n {validationState ? (\n validationState === 'invalid' ? (\n <ValidIcon />\n ) : (\n <InvalidIcon />\n )\n ) : null}\n </div>\n </div>\n {rightElement}\n </button>\n {/* since the UI components maintain some state, we can't unmount them - hide instead */}\n <div\n className={cn(\n 'mint:bg-background-light mint:dark:bg-background-dark mint:flex-1 mint:px-4 mint:rounded-b-xl mint:border-standard mint:border-t-0! mint:divide-y mint:divide-gray-100 mint:dark:divide-white/10',\n expanded && children ? '' : 'mint:hidden'\n )}\n >\n {/* Used to create the top border */}\n <div />\n {children}\n </div>\n </div>\n );\n};\n\nconst ValidIcon = () => <CheckmarkCircleRegular className=\"mint:h-4 mint:w-4 mint:bg-[#2AB673]\" />;\n\nconst InvalidIcon = () => <ErrorCircleRegular className=\"mint:h-4 mint:w-4 mint:bg-[#CB3A32]\" />;\n"],"names":["InputSectionContainer","name","validationState","children","rightElement","expanded","setExpanded","useState","jsxs","prev","cn","jsx","ChevronRightFilled","ValidIcon","InvalidIcon","CheckmarkCircleRegular","ErrorCircleRegular"],"mappings":";;;;AAcO,MAAMA,IAAwB,CAAC;AAAA,EACpC,MAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AACF,MAAmC;AACjC,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAI;AAE7C,2BACG,OAAA,EACC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,cAAW;AAAA,QACX,SAAS,MAAMF,EAAY,CAACG,MAAS,CAACA,CAAI;AAAA,QAC1C,WAAWC;AAAA,UACT;AAAA,UACAL,IAAW,oEAAoE;AAAA,QAAA;AAAA,QAGjF,UAAA;AAAA,UAAA,gBAAAG,EAAC,OAAA,EAAI,WAAU,8CACb,UAAA;AAAA,YAAA,gBAAAG;AAAA,cAACC;AAAA,cAAA;AAAA,gBACC,WAAWF;AAAA,kBACT;AAAA,kBACAL,KAAY;AAAA,gBAAA;AAAA,cACd;AAAA,YAAA;AAAA,YAEF,gBAAAG,EAAC,OAAA,EAAI,WAAU,0DACb,UAAA;AAAA,cAAA,gBAAAG,EAAC,OAAA,EAAI,WAAU,2FACZ,UAAAV,GACH;AAAA,cACCC,IACCA,MAAoB,YAClB,gBAAAS,EAACE,KAAU,IAEX,gBAAAF,EAACG,KAAY,IAEb;AAAA,YAAA,EAAA,CACN;AAAA,UAAA,GACF;AAAA,UACCV;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAGH,gBAAAI;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWE;AAAA,UACT;AAAA,UACAL,KAAYF,IAAW,KAAK;AAAA,QAAA;AAAA,QAI9B,UAAA;AAAA,UAAA,gBAAAQ,EAAC,OAAA,EAAI;AAAA,UACJR;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ,GAEMU,IAAY,MAAM,gBAAAF,EAACI,GAAA,EAAuB,WAAU,sCAAA,CAAsC,GAE1FD,IAAc,MAAM,gBAAAH,EAACK,GAAA,EAAmB,WAAU,sCAAA,CAAsC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectExpandButton.js","sources":["../../../../src/api-playground/ApiPlayground/components/ObjectExpandButton.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ObjectExpandButton.js","sources":["../../../../src/api-playground/ApiPlayground/components/ObjectExpandButton.tsx"],"sourcesContent":["\nimport { ChevronUpDownFilled } from '@fluentui/react-icons';\n\ntype ExpandButtonProps = {\n onClick: () => void;\n count?: number;\n labeled?: boolean;\n};\n\nexport const ObjectExpandButton = ({ onClick, count, labeled }: ExpandButtonProps) => {\n let expandText = '';\n if (count === 0) {\n return null;\n }\n if (count === 1) {\n expandText = 'show 1 property';\n } else {\n expandText = `show ${count} properties`;\n }\n\n if (labeled) {\n return (\n <button\n aria-label={expandText}\n onClick={onClick}\n className=\"mint:flex mint:justify-center mint:items-center mint:pt-0.5 mint:pb-0.5 mint:pl-2 mint:pr-1.5 mint:rounded-lg mint:border mint:border-gray-200 mint:dark:border-gray-800 mint:text-gray-600 mint:dark:text-gray-400\"\n >\n <span className=\"mint:text-sm mint:font-sans mint:font-medium mint:mr-1 mint:whitespace-nowrap\">{expandText}</span>\n <ChevronUpDownFilled className=\"mint:w-3.5 mint:h-3.5\" />\n </button>\n );\n } else {\n return (\n <button\n aria-label={expandText}\n onClick={onClick}\n className=\"mint:px-1 mint:text-gray-600 mint:dark:text-gray-500\"\n >\n <ChevronUpDownFilled className=\"mint:w-3.5 mint:h-3.5\" />\n </button>\n );\n }\n};\n"],"names":["ObjectExpandButton","onClick","count","labeled","expandText","jsxs","jsx","ChevronUpDownFilled"],"mappings":";;AASO,MAAMA,IAAqB,CAAC,EAAE,SAAAC,GAAS,OAAAC,GAAO,SAAAC,QAAiC;AACpF,MAAIC,IAAa;AACjB,SAAIF,MAAU,IACL,QAELA,MAAU,IACZE,IAAa,oBAEbA,IAAa,QAAQF,CAAK,eAGxBC,IAEA,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,cAAYD;AAAA,MACZ,SAAAH;AAAA,MACA,WAAU;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAAK,EAAC,QAAA,EAAK,WAAU,iFAAiF,UAAAF,GAAW;AAAA,QAC5G,gBAAAE,EAACC,GAAA,EAAoB,WAAU,wBAAA,CAAwB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAKzD,gBAAAD;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,cAAYF;AAAA,MACZ,SAAAH;AAAA,MACA,WAAU;AAAA,MAEV,UAAA,gBAAAK,EAACC,GAAA,EAAoB,WAAU,wBAAA,CAAwB;AAAA,IAAA;AAAA,EAAA;AAI/D;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathHeader.js","sources":["../../../../src/api-playground/ApiPlayground/components/PathHeader.tsx"],"sourcesContent":["'use client';\n\nimport { Endpoint } from '@mintlify/validation';\nimport { ChevronUpDownFilled } from '@fluentui/react-icons';\nimport { useContext, useEffect, useMemo, useState } from 'react';\n\nimport { getMethodColor } from '@/components/Api/colors';\nimport { MethodPill } from '../../../components/Api/MethodPill';\nimport { useApiPlaygroundInputs } from '@/hooks/useMDXContentController/useApiPlaygroundInputs';\nimport {\n addPathParams,\n addServerVariables,\n joinWithSingleSlash,\n} from '../../../hooks/useSendPlaygroundRequest';\nimport { MethodPillType } from '../../../api-playground-2/types/api';\nimport { CheckmarkCircleRegular, CopySelectRegular, SpinnerIosRegular, PlayRegular } from '@fluentui/react-icons';\nimport { copyToClipboard } from '@/utils/copyToClipboard';\n\nimport { ApiPlaygroundContext } from '../ApiPlaygroundContext';\nimport { cn } from \"../../../utils/cn\";\n\ntype EndpointHeaderProps = {\n endpoint: Endpoint;\n display: 'simple' | 'none' | 'interactive';\n onClickInteractive?: () => void;\n hasGrayBackground?: boolean;\n};\n\nexport const EndpointHeader = ({\n endpoint,\n display,\n onClickInteractive,\n hasGrayBackground,\n}: EndpointHeaderProps) => {\n return (\n <div className=\"mint:flex mint:items-center mint:space-x-1.5\">\n <PathHeader endpoint={endpoint} display={display} hasGrayBackground={hasGrayBackground} />\n {display === 'simple' ? null : (\n <SendPill method={endpoint.method} label=\"Try it\" onClick={onClickInteractive} />\n )}\n </div>\n );\n};\n\nconst BasePathSelector = () => {\n const { baseUrlOptions, selectedBaseUrlIndex, setSelectedBaseUrlIndex } =\n useContext(ApiPlaygroundContext);\n const [selectWidth, setSelectWidth] = useState(0);\n\n const selectedOption = baseUrlOptions?.[selectedBaseUrlIndex];\n\n useEffect(() => {\n // Create a temporary span to measure the text width to dynamically set the width of the select\n const span = document.createElement('span');\n span.className = 'mint:text-sm mint:absolute mint:font-mono mint:invisible';\n const storedBaseUrl = sessionStorage.getItem('selectedBaseUrl');\n if (\n storedBaseUrl &&\n storedBaseUrl !== selectedOption &&\n baseUrlOptions &&\n setSelectedBaseUrlIndex &&\n baseUrlOptions.includes(storedBaseUrl)\n ) {\n setSelectedBaseUrlIndex(baseUrlOptions.indexOf(storedBaseUrl));\n span.textContent = storedBaseUrl;\n } else {\n span.textContent = selectedOption ?? '';\n }\n document.body.appendChild(span);\n\n const paddingWidth = 16;\n\n setSelectWidth(span.offsetWidth + paddingWidth);\n document.body.removeChild(span);\n }, [selectedOption, setSelectedBaseUrlIndex, selectedBaseUrlIndex, baseUrlOptions]);\n\n if (!baseUrlOptions || baseUrlOptions.length <= 1 || !setSelectedBaseUrlIndex) return null;\n\n return (\n <div className=\"mint:flex mint:items-center mint:gap-1 mint:relative mint:-mr-1\">\n <select\n aria-label=\"Base Path Selector\"\n className=\"mint:bg-transparent mint:text-sm mint:text-gray-600 mint:dark:text-gray-400 mint:outline-0 mint:font-mono mint:cursor-pointer mint:hover:text-gray-900 mint:dark:hover:text-gray-300\"\n value={selectedBaseUrlIndex}\n onClick={(e) => e.stopPropagation()}\n onChange={(e) => {\n sessionStorage.setItem('selectedBaseUrl', baseUrlOptions[Number(e.target.value)] ?? '');\n setSelectedBaseUrlIndex(Number(e.target.value));\n }}\n style={{ width: `${selectWidth}px` }}\n >\n {baseUrlOptions.map((url, i) => (\n <option key={url} value={i}>\n {url}\n </option>\n ))}\n </select>\n <ChevronUpDownFilled\n className=\"mint:absolute mint:right-0 mint:w-3 mint:h-3 mint:text-gray-400 mint:dark:text-white/30 mint:pointer-events-none\"\n />\n </div>\n );\n};\n\nexport const PathHeader = ({ endpoint, display, hasGrayBackground }: EndpointHeaderProps) => {\n const [isCopiedActive, setIsCopiedActive] = useState(false);\n const { baseUrlOptions, selectedBaseUrlIndex } = useContext(ApiPlaygroundContext);\n const inputs = useApiPlaygroundInputs();\n\n const baseUrl = baseUrlOptions?.[selectedBaseUrlIndex] ?? baseUrlOptions?.[0] ?? '';\n\n const onCopy = async () => {\n const pathWithInputs = addPathParams(endpoint.path, inputs.path);\n const toCopy = joinWithSingleSlash(addServerVariables(baseUrl, inputs.server), pathWithInputs);\n\n const result = await copyToClipboard(toCopy);\n if (result === 'success') {\n setIsCopiedActive(true);\n setTimeout(() => {\n setIsCopiedActive(false);\n }, 2000);\n }\n };\n\n return (\n <div\n className={cn(\n 'mint:relative mint:flex-1 mint:flex mint:gap-2 mint:min-w-0 mint:rounded-xl mint:items-center mint:cursor-pointer mint:p-1.5 mint:pr-0 mint:overflow-hidden',\n display != 'simple' && 'mint:border-standard',\n hasGrayBackground && 'mint:bg-gray-50 mint:dark:bg-white/5'\n )}\n onClick={onCopy}\n >\n <MethodPill\n method={endpoint.type === 'webhook' ? 'webhook' : endpoint.method}\n isActive={false}\n />\n <div className=\"mint:flex mint:items-center mint:space-x-2 mint:overflow-x-auto mint:flex-1 mint:no-scrollbar\">\n {endpoint.type !== 'webhook' && <BasePathSelector />}\n <PrettyPath\n endpoint={endpoint}\n display={display}\n isCopiedActive={isCopiedActive}\n hasGrayBackground={hasGrayBackground}\n />\n </div>\n </div>\n );\n};\n\nconst PrettyPath = ({\n endpoint,\n isCopiedActive,\n hasGrayBackground,\n}: EndpointHeaderProps & { isCopiedActive: boolean }) => {\n const pathParts = useMemo(() => {\n return endpoint.path.split('/').flatMap((component, i) => {\n const componentParts = [];\n if (i > 0) {\n componentParts.push(<SlashPart key={i} />);\n }\n\n component.split('{').forEach((paramAndText, j) => {\n if (paramAndText.includes('}')) {\n const [param, text] = paramAndText.split('}');\n componentParts.push(\n <ParamPart key={`${i}-${j}-param`} method={endpoint.method}>\n { }\n {param!}\n </ParamPart>\n );\n if (text) {\n componentParts.push(<LiteralPart key={`${i}-${j}`}>{text}</LiteralPart>);\n }\n } else if (paramAndText) {\n componentParts.push(<LiteralPart key={`${i}-${j}`}>{paramAndText}</LiteralPart>);\n }\n });\n\n return componentParts;\n });\n }, [endpoint.path, endpoint.method]);\n\n return (\n <div className=\"mint:group mint:flex mint:items-center mint:flex-1 mint:gap-0.5 mint:font-mono mint:pr-1.5\">\n <div\n className={cn(\n 'mint:absolute mint:right-0 mint:p-2 mint:bg-background-light mint:dark:bg-background-dark mint:rounded-lg',\n hasGrayBackground && 'mint:bg-transparent mint:dark:bg-transparent',\n isCopiedActive ? 'mint:block' : 'mint:hidden mint:group-hover:block'\n )}\n >\n {isCopiedActive ? (\n <CheckmarkCircleRegular\n className=\"mint:w-4 mint:h-4 mint:bg-primary mint:dark:bg-primary-light\"\n />\n ) : (\n <CopySelectRegular className=\"mint:w-4 mint:h-4 mint:bg-gray-400 mint:dark:bg-white/30\" />\n )}\n </div>\n {pathParts}\n </div>\n );\n};\n\nconst LiteralPart = ({ children }: { children: string }) => (\n <div className=\"mint:text-sm mint:font-medium mint:text-gray-800 mint:dark:text-white mint:min-w-max\">{children}</div>\n);\n\nconst ParamPart = ({ children, method }: { children: string; method: MethodPillType }) => {\n const { activeNavPillBg, activeNavPillText, inactiveNavPillText, inactiveNavPillBg } = getMethodColor(method);\n return (\n <div\n className={cn('mint:text-sm mint:font-mono mint:font-medium mint:rounded-md mint:px-1 mint:border-2 mint:min-w-max', activeNavPillBg, activeNavPillText, inactiveNavPillText, inactiveNavPillBg)}\n >{`\\{${children}\\}`}</div>\n );\n};\n\nconst SlashPart = () => <div className=\"mint:text-sm mint:text-gray-400\">/</div>;\n\nexport const SendPill = ({\n label,\n method,\n onClick,\n isSending,\n className,\n}: {\n label: string;\n method: MethodPillType;\n onClick?: () => void;\n isSending?: boolean;\n className?: string;\n}) => {\n const { activeNavPillBg } = getMethodColor(method);\n return (\n <button\n className={cn(\n 'try-it-button',\n 'mint:flex mint:items-center mint:justify-center mint:px-3 mint:h-9 mint:text-white mint:font-medium mint:rounded-xl mint:mouse-pointer mint:disabled:opacity-70 mint:hover:opacity-80 mint:gap-1.5',\n activeNavPillBg,\n className\n )}\n onClick={onClick}\n disabled={isSending}\n data-testid=\"try-it-button\"\n >\n {isSending ? (\n <SpinnerIosRegular className=\"mint:w-4 mint:h-4 mint:bg-white mint:animate-spin\" />\n ) : (\n <>\n <span>{label}</span>\n <PlayRegular className=\"mint:w-3 mint:h-3 mint:bg-white\" />\n </>\n )}\n </button>\n );\n};\n"],"names":["EndpointHeader","endpoint","display","onClickInteractive","hasGrayBackground","jsxs","jsx","PathHeader","SendPill","BasePathSelector","baseUrlOptions","selectedBaseUrlIndex","setSelectedBaseUrlIndex","useContext","ApiPlaygroundContext","selectWidth","setSelectWidth","useState","selectedOption","useEffect","span","storedBaseUrl","url","i","ChevronUpDownFilled","isCopiedActive","setIsCopiedActive","inputs","useApiPlaygroundInputs","baseUrl","onCopy","pathWithInputs","addPathParams","toCopy","joinWithSingleSlash","addServerVariables","copyToClipboard","cn","MethodPill","PrettyPath","pathParts","useMemo","component","componentParts","SlashPart","paramAndText","j","param","text","ParamPart","LiteralPart","CheckmarkCircleRegular","CopySelectRegular","children","method","activeNavPillBg","activeNavPillText","inactiveNavPillText","inactiveNavPillBg","getMethodColor","label","onClick","isSending","className","SpinnerIosRegular","Fragment","PlayRegular"],"mappings":";;;;;;;;;;AA4BO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,mBAAAC;AACF,MAEI,gBAAAC,EAAC,OAAA,EAAI,WAAU,gDACb,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAA,EAAW,UAAAN,GAAoB,SAAAC,GAAkB,mBAAAE,EAAA,CAAsC;AAAA,EACvFF,MAAY,WAAW,OACtB,gBAAAI,EAACE,GAAA,EAAS,QAAQP,EAAS,QAAQ,OAAM,UAAS,SAASE,EAAA,CAAoB;AAAA,GAEnF,GAIEM,IAAmB,MAAM;AAC7B,QAAM,EAAE,gBAAAC,GAAgB,sBAAAC,GAAsB,yBAAAC,EAAA,IAC5CC,EAAWC,CAAoB,GAC3B,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAE1CC,IAAiBR,KAAA,gBAAAA,EAAiBC;AA2BxC,SAzBAQ,EAAU,MAAM;AAEd,UAAMC,IAAO,SAAS,cAAc,MAAM;AAC1C,IAAAA,EAAK,YAAY;AACjB,UAAMC,IAAgB,eAAe,QAAQ,iBAAiB;A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AAAC,GAAiB,mBAAAC,GAAmB,qBAAAC,GAAqB,mBAAAC,EAAA,IAAsBC,EAAeL,CAAM;AAC5G,SACE,gBAAAhD;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW+B,EAAG,uGAAuGkB,GAAiBC,GAAmBC,GAAqBC,CAAiB;AAAA,MAC/L,cAAKL,CAAQ;AAAA,IAAA;AAAA,EAAA;AAEnB,GAEMT,IAAY,MAAM,gBAAAtC,EAAC,OAAA,EAAI,WAAU,mCAAkC,UAAA,KAAC,GAE7DE,IAAW,CAAC;AAAA,EACvB,OAAAoD;AAAA,EACA,QAAAN;AAAA,EACA,SAAAO;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AACF,MAMM;AACJ,QAAM,EAAE,iBAAAR,EAAA,IAAoBI,EAAeL,CAAM;AACjD,SACE,gBAAAhD;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW+B;AAAA,QACT;AAAA,QACA;AAAA,QACAkB;AAAA,QACAQ;AAAA,MAAA;AAAA,MAEF,SAAAF;AAAA,MACA,UAAUC;AAAA,MACV,eAAY;AAAA,MAEX,cACC,gBAAAxD,EAAC0D,GAAA,EAAkB,WAAU,oDAAA,CAAoD,IAEjF,gBAAA3D,EAAA4D,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA3D,EAAC,UAAM,UAAAsD,EAAA,CAAM;AAAA,QACb,gBAAAtD,EAAC4D,GAAA,EAAY,WAAU,kCAAA,CAAkC;AAAA,MAAA,EAAA,CAC3D;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
1
|
+
{"version":3,"file":"PathHeader.js","sources":["../../../../src/api-playground/ApiPlayground/components/PathHeader.tsx"],"sourcesContent":["\nimport { Endpoint } from '@mintlify/validation';\nimport { ChevronUpDownFilled } from '@fluentui/react-icons';\nimport { useContext, useEffect, useMemo, useState } from 'react';\n\nimport { getMethodColor } from '@/components/Api/colors';\nimport { MethodPill } from '../../../components/Api/MethodPill';\nimport { useApiPlaygroundInputs } from '@/hooks/useMDXContentController/useApiPlaygroundInputs';\nimport {\n addPathParams,\n addServerVariables,\n joinWithSingleSlash,\n} from '../../../hooks/useSendPlaygroundRequest';\nimport { MethodPillType } from '../../../api-playground-2/types/api';\nimport { CheckmarkCircleRegular, CopySelectRegular, SpinnerIosRegular, PlayRegular } from '@fluentui/react-icons';\nimport { copyToClipboard } from '@/utils/copyToClipboard';\n\nimport { ApiPlaygroundContext } from '../ApiPlaygroundContext';\nimport { cn } from \"../../../utils/cn\";\n\ntype EndpointHeaderProps = {\n endpoint: Endpoint;\n display: 'simple' | 'none' | 'interactive';\n onClickInteractive?: () => void;\n hasGrayBackground?: boolean;\n};\n\nexport const EndpointHeader = ({\n endpoint,\n display,\n onClickInteractive,\n hasGrayBackground,\n}: EndpointHeaderProps) => {\n return (\n <div className=\"mint:flex mint:items-center mint:space-x-1.5\">\n <PathHeader endpoint={endpoint} display={display} hasGrayBackground={hasGrayBackground} />\n {display === 'simple' ? null : (\n <SendPill method={endpoint.method} label=\"Try it\" onClick={onClickInteractive} />\n )}\n </div>\n );\n};\n\nconst BasePathSelector = () => {\n const { baseUrlOptions, selectedBaseUrlIndex, setSelectedBaseUrlIndex } =\n useContext(ApiPlaygroundContext);\n const [selectWidth, setSelectWidth] = useState(0);\n\n const selectedOption = baseUrlOptions?.[selectedBaseUrlIndex];\n\n useEffect(() => {\n // Create a temporary span to measure the text width to dynamically set the width of the select\n const span = document.createElement('span');\n span.className = 'mint:text-sm mint:absolute mint:font-mono mint:invisible';\n const storedBaseUrl = sessionStorage.getItem('selectedBaseUrl');\n if (\n storedBaseUrl &&\n storedBaseUrl !== selectedOption &&\n baseUrlOptions &&\n setSelectedBaseUrlIndex &&\n baseUrlOptions.includes(storedBaseUrl)\n ) {\n setSelectedBaseUrlIndex(baseUrlOptions.indexOf(storedBaseUrl));\n span.textContent = storedBaseUrl;\n } else {\n span.textContent = selectedOption ?? '';\n }\n document.body.appendChild(span);\n\n const paddingWidth = 16;\n\n setSelectWidth(span.offsetWidth + paddingWidth);\n document.body.removeChild(span);\n }, [selectedOption, setSelectedBaseUrlIndex, selectedBaseUrlIndex, baseUrlOptions]);\n\n if (!baseUrlOptions || baseUrlOptions.length <= 1 || !setSelectedBaseUrlIndex) return null;\n\n return (\n <div className=\"mint:flex mint:items-center mint:gap-1 mint:relative mint:-mr-1\">\n <select\n aria-label=\"Base Path Selector\"\n className=\"mint:bg-transparent mint:text-sm mint:text-gray-600 mint:dark:text-gray-400 mint:outline-0 mint:font-mono mint:cursor-pointer mint:hover:text-gray-900 mint:dark:hover:text-gray-300\"\n value={selectedBaseUrlIndex}\n onClick={(e) => e.stopPropagation()}\n onChange={(e) => {\n sessionStorage.setItem('selectedBaseUrl', baseUrlOptions[Number(e.target.value)] ?? '');\n setSelectedBaseUrlIndex(Number(e.target.value));\n }}\n style={{ width: `${selectWidth}px` }}\n >\n {baseUrlOptions.map((url, i) => (\n <option key={url} value={i}>\n {url}\n </option>\n ))}\n </select>\n <ChevronUpDownFilled\n className=\"mint:absolute mint:right-0 mint:w-3 mint:h-3 mint:text-gray-400 mint:dark:text-white/30 mint:pointer-events-none\"\n />\n </div>\n );\n};\n\nexport const PathHeader = ({ endpoint, display, hasGrayBackground }: EndpointHeaderProps) => {\n const [isCopiedActive, setIsCopiedActive] = useState(false);\n const { baseUrlOptions, selectedBaseUrlIndex } = useContext(ApiPlaygroundContext);\n const inputs = useApiPlaygroundInputs();\n\n const baseUrl = baseUrlOptions?.[selectedBaseUrlIndex] ?? baseUrlOptions?.[0] ?? '';\n\n const onCopy = async () => {\n const pathWithInputs = addPathParams(endpoint.path, inputs.path);\n const toCopy = joinWithSingleSlash(addServerVariables(baseUrl, inputs.server), pathWithInputs);\n\n const result = await copyToClipboard(toCopy);\n if (result === 'success') {\n setIsCopiedActive(true);\n setTimeout(() => {\n setIsCopiedActive(false);\n }, 2000);\n }\n };\n\n return (\n <div\n className={cn(\n 'mint:relative mint:flex-1 mint:flex mint:gap-2 mint:min-w-0 mint:rounded-xl mint:items-center mint:cursor-pointer mint:p-1.5 mint:pr-0 mint:overflow-hidden',\n display != 'simple' && 'mint:border-standard',\n hasGrayBackground && 'mint:bg-gray-50 mint:dark:bg-white/5'\n )}\n onClick={onCopy}\n >\n <MethodPill\n method={endpoint.type === 'webhook' ? 'webhook' : endpoint.method}\n isActive={false}\n />\n <div className=\"mint:flex mint:items-center mint:space-x-2 mint:overflow-x-auto mint:flex-1 mint:no-scrollbar\">\n {endpoint.type !== 'webhook' && <BasePathSelector />}\n <PrettyPath\n endpoint={endpoint}\n display={display}\n isCopiedActive={isCopiedActive}\n hasGrayBackground={hasGrayBackground}\n />\n </div>\n </div>\n );\n};\n\nconst PrettyPath = ({\n endpoint,\n isCopiedActive,\n hasGrayBackground,\n}: EndpointHeaderProps & { isCopiedActive: boolean }) => {\n const pathParts = useMemo(() => {\n return endpoint.path.split('/').flatMap((component, i) => {\n const componentParts = [];\n if (i > 0) {\n componentParts.push(<SlashPart key={i} />);\n }\n\n component.split('{').forEach((paramAndText, j) => {\n if (paramAndText.includes('}')) {\n const [param, text] = paramAndText.split('}');\n componentParts.push(\n <ParamPart key={`${i}-${j}-param`} method={endpoint.method}>\n { }\n {param!}\n </ParamPart>\n );\n if (text) {\n componentParts.push(<LiteralPart key={`${i}-${j}`}>{text}</LiteralPart>);\n }\n } else if (paramAndText) {\n componentParts.push(<LiteralPart key={`${i}-${j}`}>{paramAndText}</LiteralPart>);\n }\n });\n\n return componentParts;\n });\n }, [endpoint.path, endpoint.method]);\n\n return (\n <div className=\"mint:group mint:flex mint:items-center mint:flex-1 mint:gap-0.5 mint:font-mono mint:pr-1.5\">\n <div\n className={cn(\n 'mint:absolute mint:right-0 mint:p-2 mint:bg-background-light mint:dark:bg-background-dark mint:rounded-lg',\n hasGrayBackground && 'mint:bg-transparent mint:dark:bg-transparent',\n isCopiedActive ? 'mint:block' : 'mint:hidden mint:group-hover:block'\n )}\n >\n {isCopiedActive ? (\n <CheckmarkCircleRegular\n className=\"mint:w-4 mint:h-4 mint:bg-primary mint:dark:bg-primary-light\"\n />\n ) : (\n <CopySelectRegular className=\"mint:w-4 mint:h-4 mint:bg-gray-400 mint:dark:bg-white/30\" />\n )}\n </div>\n {pathParts}\n </div>\n );\n};\n\nconst LiteralPart = ({ children }: { children: string }) => (\n <div className=\"mint:text-sm mint:font-medium mint:text-gray-800 mint:dark:text-white mint:min-w-max\">{children}</div>\n);\n\nconst ParamPart = ({ children, method }: { children: string; method: MethodPillType }) => {\n const { activeNavPillBg, activeNavPillText, inactiveNavPillText, inactiveNavPillBg } = getMethodColor(method);\n return (\n <div\n className={cn('mint:text-sm mint:font-mono mint:font-medium mint:rounded-md mint:px-1 mint:border-2 mint:min-w-max', activeNavPillBg, activeNavPillText, inactiveNavPillText, inactiveNavPillBg)}\n >{`\\{${children}\\}`}</div>\n );\n};\n\nconst SlashPart = () => <div className=\"mint:text-sm mint:text-gray-400\">/</div>;\n\nexport const SendPill = ({\n label,\n method,\n onClick,\n isSending,\n className,\n}: {\n label: string;\n method: MethodPillType;\n onClick?: () => void;\n isSending?: boolean;\n className?: string;\n}) => {\n const { activeNavPillBg } = getMethodColor(method);\n return (\n <button\n className={cn(\n 'try-it-button',\n 'mint:flex mint:items-center mint:justify-center mint:px-3 mint:h-9 mint:text-white mint:font-medium mint:rounded-xl mint:mouse-pointer mint:disabled:opacity-70 mint:hover:opacity-80 mint:gap-1.5',\n activeNavPillBg,\n className\n )}\n onClick={onClick}\n disabled={isSending}\n data-testid=\"try-it-button\"\n >\n {isSending ? (\n <SpinnerIosRegular className=\"mint:w-4 mint:h-4 mint:bg-white mint:animate-spin\" />\n ) : (\n <>\n <span>{label}</span>\n <PlayRegular className=\"mint:w-3 mint:h-3 mint:bg-white\" />\n </>\n )}\n </button>\n );\n};\n"],"names":["EndpointHeader","endpoint","display","onClickInteractive","hasGrayBackground","jsxs","jsx","PathHeader","SendPill","BasePathSelector","baseUrlOptions","selectedBaseUrlIndex","setSelectedBaseUrlIndex","useContext","ApiPlaygroundContext","selectWidth","setSelectWidth","useState","selectedOption","useEffect","span","storedBaseUrl","url","i","ChevronUpDownFilled","isCopiedActive","setIsCopiedActive","inputs","useApiPlaygroundInputs","baseUrl","onCopy","pathWithInputs","addPathParams","toCopy","joinWithSingleSlash","addServerVariables","copyToClipboard","cn","MethodPill","PrettyPath","pathParts","useMemo","component","componentParts","SlashPart","paramAndText","j","param","text","ParamPart","LiteralPart","CheckmarkCircleRegular","CopySelectRegular","children","method","activeNavPillBg","activeNavPillText","inactiveNavPillText","inactiveNavPillBg","getMethodColor","label","onClick","isSending","className","SpinnerIosRegular","Fragment","PlayRegular"],"mappings":";;;;;;;;;;AA2BO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,mBAAAC;AACF,MAEI,gBAAAC,EAAC,OAAA,EAAI,WAAU,gDACb,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAA,EAAW,UAAAN,GAAoB,SAAAC,GAAkB,mBAAAE,EAAA,CAAsC;AAAA,EACvFF,MAAY,WAAW,OACtB,gBAAAI,EAACE,GAAA,EAAS,QAAQP,EAAS,QAAQ,OAAM,UAAS,SAASE,EAAA,CAAoB;AAAA,GAEnF,GAIEM,IAAmB,MAAM;AAC7B,QAAM,EAAE,gBAAAC,GAAgB,sBAAAC,GAAsB,yBAAAC,EAAA,IAC5CC,EAAWC,CAAoB,GAC3B,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAE1CC,IAAiBR,KAAA,gBAAAA,EAAiBC;AA2BxC,SAzBAQ,EAAU,MAAM;AAEd,UAAMC,IAAO,SAAS,cAAc,MAAM;AAC1C,IAAAA,EAAK,YAAY;AACjB,UAAMC,IAAgB,eAAe,QAAQ,iBAAiB;AAC9D,IACEA,KACAA,MAAkBH,KAClBR,KACAE,KACAF,EAAe,SAASW,CAAa,KAErCT,EAAwBF,EAAe,QAAQW,CAAa,CAAC,GAC7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AAC;AAAA,IAAA;AAAA,MACC,WAAW+B,EAAG,uGAAuGkB,GAAiBC,GAAmBC,GAAqBC,CAAiB;AAAA,MAC/L,cAAKL,CAAQ;AAAA,IAAA;AAAA,EAAA;AAEnB,GAEMT,IAAY,MAAM,gBAAAtC,EAAC,OAAA,EAAI,WAAU,mCAAkC,UAAA,KAAC,GAE7DE,IAAW,CAAC;AAAA,EACvB,OAAAoD;AAAA,EACA,QAAAN;AAAA,EACA,SAAAO;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AACF,MAMM;AACJ,QAAM,EAAE,iBAAAR,EAAA,IAAoBI,EAAeL,CAAM;AACjD,SACE,gBAAAhD;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW+B;AAAA,QACT;AAAA,QACA;AAAA,QACAkB;AAAA,QACAQ;AAAA,MAAA;AAAA,MAEF,SAAAF;AAAA,MACA,UAAUC;AAAA,MACV,eAAY;AAAA,MAEX,cACC,gBAAAxD,EAAC0D,GAAA,EAAkB,WAAU,oDAAA,CAAoD,IAEjF,gBAAA3D,EAAA4D,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA3D,EAAC,UAAM,UAAAsD,EAAA,CAAM;AAAA,QACb,gBAAAtD,EAAC4D,GAAA,EAAY,WAAU,kCAAA,CAAkC;AAAA,MAAA,EAAA,CAC3D;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaygroundModalWrapper.js","sources":["../../../../src/api-playground/ApiPlayground/components/PlaygroundModalWrapper.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"PlaygroundModalWrapper.js","sources":["../../../../src/api-playground/ApiPlayground/components/PlaygroundModalWrapper.tsx"],"sourcesContent":["\nimport { Transition, TransitionChild } from '@headlessui/react';\nimport { Fragment } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { zIndex } from '@/constants/zIndex';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\ntype PlaygroundModalWrapperProps = {\n isPlaygroundExpanded: boolean;\n setIsPlaygroundExpanded?: (isPlaygroundExpanded: boolean) => void;\n children: React.ReactNode;\n};\n\nexport const PlaygroundModalWrapper = ({\n isPlaygroundExpanded,\n setIsPlaygroundExpanded,\n children,\n}: PlaygroundModalWrapperProps) => {\n if (typeof window === 'undefined') return null;\n\n return createPortal(\n <Transition show={isPlaygroundExpanded} as={Fragment}>\n <div className={cn(zIndex.Popup, 'mint:fixed mint:inset-0 mint:overflow-y-auto mint:p-4 mint:sm:p-6 mint:md:p-12')}>\n <TransitionChild\n as={Fragment}\n enter=\"mint:ease-out mint:duration-100\"\n enterFrom=\"mint:opacity-0\"\n enterTo=\"mint:opacity-100\"\n leave=\"mint:ease-in mint:duration-50\"\n leaveFrom=\"mint:opacity-100\"\n leaveTo=\"mint:opacity-0\"\n >\n <div\n className=\"mint:fixed mint:z-0 mint:inset-0 mint:bg-background-dark/20 mint:transition-opacity mint:backdrop-blur-sm\"\n onClick={() => setIsPlaygroundExpanded?.(false)}\n />\n </TransitionChild>\n <TransitionChild\n as={Fragment}\n enter=\"mint:ease-out mint:duration-100\"\n enterFrom=\"mint:opacity-0 mint:scale-95\"\n enterTo=\"mint:opacity-100 mint:scale-100\"\n leave=\"mint:ease-in mint:duration-50\"\n leaveFrom=\"mint:opacity-100 mint:scale-100\"\n leaveTo=\"mint:opacity-0 mint:scale-95\"\n >\n <div\n data-testid=\"api-playground-modal\"\n className=\"mint:relative mint:z-10 mint:flex mint:flex-col mint:mx-auto mint:max-w-screen-xl mint:transform mint:bg-background-light mint:dark:bg-background-dark mint:shadow-search mint:rounded-3xl mint:border-standard\">\n <div className=\"mint:p-4\">{children}</div>\n </div>\n </TransitionChild>\n </div>\n </Transition>,\n document.body\n );\n};\n"],"names":["PlaygroundModalWrapper","isPlaygroundExpanded","setIsPlaygroundExpanded","children","createPortal","jsx","Transition","Fragment","jsxs","cn","zIndex","TransitionChild"],"mappings":";;;;;;;AAcO,MAAMA,IAAyB,CAAC;AAAA,EACrC,sBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,UAAAC;AACF,MACM,OAAO,SAAW,MAAoB,OAEnCC;AAAA,EACL,gBAAAC,EAACC,GAAA,EAAW,MAAML,GAAsB,IAAIM,GAC1C,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAGC,EAAO,OAAO,gFAAgF,GAC/G,UAAA;AAAA,IAAA,gBAAAL;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,IAAIJ;AAAA,QACJ,OAAM;AAAA,QACN,WAAU;AAAA,QACV,SAAQ;AAAA,QACR,OAAM;AAAA,QACN,WAAU;AAAA,QACV,SAAQ;AAAA,QAER,UAAA,gBAAAF;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,SAAS,MAAMH,KAAA,gBAAAA,EAA0B;AAAA,UAAK;AAAA,QAAA;AAAA,MAChD;AAAA,IAAA;AAAA,IAEF,gBAAAG;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,IAAIJ;AAAA,QACJ,OAAM;AAAA,QACN,WAAU;AAAA,QACV,SAAQ;AAAA,QACR,OAAM;AAAA,QACN,WAAU;AAAA,QACV,SAAQ;AAAA,QAER,UAAA,gBAAAF;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,eAAY;AAAA,YACZ,WAAU;AAAA,YACV,UAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,YAAY,UAAAF,EAAA,CAAS;AAAA,UAAA;AAAA,QAAA;AAAA,MACtC;AAAA,IAAA;AAAA,EACF,EAAA,CACF,EAAA,CACF;AAAA,EACA,SAAS;AAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrashButton.js","sources":["../../../../src/api-playground/ApiPlayground/components/TrashButton.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"TrashButton.js","sources":["../../../../src/api-playground/ApiPlayground/components/TrashButton.tsx"],"sourcesContent":["\nimport { useSelectedLocale } from '@/utils/locales';\nimport { TrashIcon } from 'lucide-react';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nexport const TrashButton = ({\n className,\n onClick,\n}: {\n className?: string;\n onClick?: () => void;\n}) => {\n const locale = useSelectedLocale();\n\n return (\n <button\n className={cn(\n 'mint:px-1 mint:text-gray-400 mint:dark:text-gray-600 mint:hover:text-gray-600 mint:dark:hover:text-gray-400',\n className\n )}\n onClick={onClick}\n aria-label={locale['aria.deleteItem']}\n >\n <TrashIcon className=\"mint:w-4 mint:h-4\" />\n </button>\n );\n};\n"],"names":["TrashButton","className","onClick","locale","useSelectedLocale","jsx","cn","TrashIcon"],"mappings":";;;;;AAKO,MAAMA,IAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,SAAAC;AACF,MAGM;AACJ,QAAMC,IAASC,EAAA;AAEf,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAL;AAAA,MAAA;AAAA,MAEF,SAAAC;AAAA,MACA,cAAYC,EAAO,iBAAiB;AAAA,MAEpC,UAAA,gBAAAE,EAACE,GAAA,EAAU,WAAU,oBAAA,CAAoB;AAAA,IAAA;AAAA,EAAA;AAG/C;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeDropdown.js","sources":["../../../../src/api-playground/ApiPlayground/components/TypeDropdown.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"TypeDropdown.js","sources":["../../../../src/api-playground/ApiPlayground/components/TypeDropdown.tsx"],"sourcesContent":["\nimport { ChevronDownFilled } from '@fluentui/react-icons';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/Api/dropdown-menu';\nimport { SchemaWithLabelInfo } from '@/hooks/usePlaygroundSchemaOptions';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\ntype TypeDropdownParams = {\n options: SchemaWithLabelInfo[];\n selectedIndex: number;\n onSelectOption: (index: number) => void;\n className?: string;\n};\n\nfunction getOptionLabel(option?: SchemaWithLabelInfo) {\n if (!option) return;\n if (option.schema.deprecated) {\n return `${option.label}, deprecated`;\n }\n return option.label;\n}\n\nexport const TypeDropdown = ({\n options,\n selectedIndex,\n onSelectOption,\n className,\n}: TypeDropdownParams) => {\n const displayOptions = options.length > 1;\n const selectedOption = options[selectedIndex];\n\n return (\n <div\n className={cn(\n 'mint:relative mint:flex mint:items-center mint:px-2 mint:py-0.5 mint:text-gray-600 mint:dark:text-gray-300 mint:hover:text-gray-950 mint:dark:hover:text-white mint:font-medium',\n className\n )}\n >\n <DropdownMenu>\n <DropdownMenuTrigger\n disabled={!displayOptions}\n className=\"mint:font-mono mint:text-xs mint:text-gray-600 mint:dark:text-gray-300 mint:hover:text-gray-950 mint:dark:hover:text-white\"\n >\n <div className=\"mint:flex mint:items-center mint:gap-1.5\">\n <span>{getOptionLabel(selectedOption)}</span>\n {displayOptions && (\n <ChevronDownFilled className=\"mint:h-2.5 mint:w-2.5 mint:text-gray-500 mint:dark:text-gray-400 mint:shrink-0\" />\n )}\n </div>\n </DropdownMenuTrigger>\n <DropdownMenuContent className=\"mint:min-w-24\">\n {options.map((option, index) => (\n <DropdownMenuItem\n key={index}\n isSelected={index === selectedIndex}\n onSelect={() => onSelectOption(index)}\n className=\"mint:text-xs\"\n >\n {getOptionLabel(option)}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n};\n"],"names":["getOptionLabel","option","TypeDropdown","options","selectedIndex","onSelectOption","className","displayOptions","selectedOption","jsx","cn","DropdownMenu","DropdownMenuTrigger","jsxs","ChevronDownFilled","DropdownMenuContent","index","DropdownMenuItem"],"mappings":";;;;;AAmBA,SAASA,EAAeC,GAA8B;AACpD,MAAKA;AACL,WAAIA,EAAO,OAAO,aACT,GAAGA,EAAO,KAAK,iBAEjBA,EAAO;AAChB;AAEO,MAAMC,IAAe,CAAC;AAAA,EAC3B,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AACF,MAA0B;AACxB,QAAMC,IAAiBJ,EAAQ,SAAS,GAClCK,IAAiBL,EAAQC,CAAa;AAE5C,SACE,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MAAA;AAAA,MAGF,4BAACK,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,UAAU,CAACL;AAAA,YACX,WAAU;AAAA,YAEV,UAAA,gBAAAM,EAAC,OAAA,EAAI,WAAU,4CACb,UAAA;AAAA,cAAA,gBAAAJ,EAAC,QAAA,EAAM,UAAAT,EAAeQ,CAAc,EAAA,CAAE;AAAA,cACrCD,KACC,gBAAAE,EAACK,GAAA,EAAkB,WAAU,iFAAA,CAAiF;AAAA,YAAA,EAAA,CAElH;AAAA,UAAA;AAAA,QAAA;AAAA,QAEF,gBAAAL,EAACM,KAAoB,WAAU,iBAC5B,YAAQ,IAAI,CAACd,GAAQe,MACpB,gBAAAP;AAAA,UAACQ;AAAA,UAAA;AAAA,YAEC,YAAYD,MAAUZ;AAAA,YACtB,UAAU,MAAMC,EAAeW,CAAK;AAAA,YACpC,WAAU;AAAA,YAET,YAAef,CAAM;AAAA,UAAA;AAAA,UALjBe;AAAA,QAAA,CAOR,EAAA,CACH;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/api-playground/ApiPlayground/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/api-playground/ApiPlayground/index.tsx"],"sourcesContent":["\nimport { ApiPlaygroundResultType, ApiPlaygroundDisplayType } from '@mintlify/models';\nimport { Endpoint } from '@mintlify/validation';\nimport { useContext, useEffect, useState } from 'react';\n\nimport { DocsConfigContext } from '@/contexts/ConfigContext';\nimport { EndpointLocationProvider } from '@/contexts/EndpointLocationContext';\nimport { useBaseUrlOptions } from '../../hooks/useBaseUrlOptions';\nimport { useKeyboardShortcut } from '@/hooks/useKeyboardShortcut';\nimport { useApiPlaygroundInputs } from '@/hooks/useMDXContentController/useApiPlaygroundInputs';\nimport { useSetApiBaseIndexCallback } from '@/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback';\nimport { useSetApiPlaygroundInputsCallback } from '@/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback';\nimport { useSendPlaygroundRequest } from '@/hooks/useSendPlaygroundRequest';\nimport ErrorBoundary from '@/components/Api/ErrorBoundary';\n\nimport { ApiPlaygroundContext } from './ApiPlaygroundContext';\nimport { Request } from './Request';\nimport { cn } from \"../../utils/cn\";\n\ntype ApiPlaygroundParams = {\n endpoint: Endpoint;\n display: ApiPlaygroundDisplayType;\n pathname: string;\n};\n\nexport const ApiPlayground = ({ endpoint, display, pathname }: ApiPlaygroundParams) => {\n const { docsConfig } = useContext(DocsConfigContext);\n const inputs = useApiPlaygroundInputs();\n const setInputs = useSetApiPlaygroundInputsCallback();\n const setApiBaseIndex = useSetApiBaseIndexCallback();\n\n const baseUrlOptions = useBaseUrlOptions();\n const [selectedBaseUrlIndex, setSelectedBaseUrlIndex] = useState(0);\n const [isPlaygroundExpanded, setIsPlaygroundExpanded] = useState(false);\n\n const [isSending, setIsSending] = useState(false);\n const [result, setResult] = useState<ApiPlaygroundResultType>();\n\n const [selectedContentTypeIndex, _setSelectedContentTypeIndex] = useState(0);\n const contentType = Object.keys(endpoint.request.body)[selectedContentTypeIndex];\n const [selectedExampleIndex, setSelectedExampleIndex] = useState(0);\n\n const baseUrl = baseUrlOptions?.[selectedBaseUrlIndex] ?? baseUrlOptions?.[0] ?? '';\n\n useEffect(() => {\n const searchParams = new URLSearchParams(window.location.search);\n if (searchParams.has('playground')) {\n requestAnimationFrame(() => {\n setIsPlaygroundExpanded(true);\n });\n }\n }, []);\n\n const sendRequest = useSendPlaygroundRequest({\n endpoint,\n baseUrl,\n contentType: contentType ?? 'application/json',\n setIsFetching: setIsSending,\n setResult,\n });\n\n const setBaseUrlIndex = (index: number) => {\n setSelectedBaseUrlIndex(index);\n setApiBaseIndex(index);\n };\n\n const setIsPlaygroundExpandedWithQueryParam = (expanded: boolean) => {\n setIsPlaygroundExpanded(expanded);\n if (expanded) {\n const url = new URL(window.location.href);\n url.searchParams.set('playground', 'open');\n window.history.replaceState({}, '', url);\n } else {\n const url = new URL(window.location.href);\n url.searchParams.delete('playground');\n window.history.replaceState({}, '', url);\n }\n };\n\n useKeyboardShortcut({\n key: 'Enter',\n callback: docsConfig?.api?.playground?.display === 'interactive' ? sendRequest : undefined,\n });\n useKeyboardShortcut({\n key: 'Escape',\n callback: isPlaygroundExpanded ? () => setIsPlaygroundExpandedWithQueryParam(false) : undefined,\n isSingleKey: true,\n });\n\n return (\n <ErrorBoundary>\n <ApiPlaygroundContext.Provider\n value={{\n isSending,\n sendRequest,\n result,\n setSelectedBaseUrlIndex: setBaseUrlIndex,\n selectedBaseUrlIndex,\n baseUrlOptions,\n isPlaygroundExpanded,\n setIsPlaygroundExpanded: setIsPlaygroundExpandedWithQueryParam,\n selectedExampleIndex,\n setSelectedExampleIndex,\n }}\n >\n <div className=\"mint:mt-6 mint:flex mint:w-full mint:flex-col mint:space-y-4\">\n <EndpointLocationProvider location=\"request\">\n <Request inputs={inputs} setInputs={setInputs} endpoint={endpoint} display={display} pathname={pathname} />\n </EndpointLocationProvider>\n </div>\n </ApiPlaygroundContext.Provider>\n </ErrorBoundary>\n );\n};\n"],"names":["ApiPlayground","endpoint","display","pathname","docsConfig","useContext","DocsConfigContext","inputs","useApiPlaygroundInputs","setInputs","useSetApiPlaygroundInputsCallback","setApiBaseIndex","useSetApiBaseIndexCallback","baseUrlOptions","useBaseUrlOptions","selectedBaseUrlIndex","setSelectedBaseUrlIndex","useState","isPlaygroundExpanded","setIsPlaygroundExpanded","isSending","setIsSending","result","setResult","selectedContentTypeIndex","_setSelectedContentTypeIndex","contentType","selectedExampleIndex","setSelectedExampleIndex","baseUrl","useEffect","sendRequest","useSendPlaygroundRequest","setBaseUrlIndex","index","setIsPlaygroundExpandedWithQueryParam","expanded","url","useKeyboardShortcut","_b","_a","ErrorBoundary","jsx","ApiPlaygroundContext","EndpointLocationProvider","Request"],"mappings":";;;;;;;;;;;;;AAyBO,MAAMA,KAAgB,CAAC,EAAE,UAAAC,GAAU,SAAAC,GAAS,UAAAC,QAAoC;;AACrF,QAAM,EAAE,YAAAC,EAAA,IAAeC,EAAWC,CAAiB,GAC7CC,IAASC,EAAA,GACTC,IAAYC,EAAA,GACZC,IAAkBC,EAAA,GAElBC,IAAiBC,EAAA,GACjB,CAACC,GAAsBC,CAAuB,IAAIC,EAAS,CAAC,GAC5D,CAACC,GAAsBC,CAAuB,IAAIF,EAAS,EAAK,GAEhE,CAACG,GAAWC,CAAY,IAAIJ,EAAS,EAAK,GAC1C,CAACK,GAAQC,CAAS,IAAIN,EAAA,GAEtB,CAACO,GAA0BC,CAA4B,IAAIR,EAAS,CAAC,GACrES,IAAc,OAAO,KAAKzB,EAAS,QAAQ,IAAI,EAAEuB,CAAwB,GACzE,CAACG,GAAsBC,CAAuB,IAAIX,EAAS,CAAC,GAE5DY,KAAUhB,KAAA,gBAAAA,EAAiBE,QAAyBF,KAAA,gBAAAA,EAAiB,OAAM;AAEjF,EAAAiB,EAAU,MAAM;AAEd,IADqB,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAC9C,IAAI,YAAY,KAC/B,sBAAsB,MAAM;AAC1B,MAAAX,EAAwB,EAAI;AAAA,IAC9B,CAAC;AAAA,EAEL,GAAG,CAAA,CAAE;AAEL,QAAMY,IAAcC,EAAyB;AAAA,IAC3C,UAAA/B;AAAA,IACA,SAAA4B;AAAA,IACA,aAAaH,KAAe;AAAA,IAC5B,eAAeL;AAAA,IACf,WAAAE;AAA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AAsB,UAAAR,GAAoB,SAAAC,GAAkB,UAAAC,GAAoB,GAC3G,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberMetadata.js","sources":["../../../../../src/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"NumberMetadata.js","sources":["../../../../../src/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.tsx"],"sourcesContent":["\nimport { NumberSchema } from '@mintlify/validation';\n\nexport const NumberMetadata = ({ schema }: { schema: NumberSchema }) => {\n const exclusiveMinimum = schema.exclusiveMinimum || schema.exclusiveMinimum !== undefined;\n const exclusiveMaximum = schema.exclusiveMaximum || schema.exclusiveMaximum !== undefined;\n let range = '';\n if (schema.maximum !== undefined) {\n range = `x ${exclusiveMaximum ? '<' : '<='} ${schema.maximum}`;\n }\n if (schema.minimum !== undefined) {\n range = `x ${exclusiveMinimum ? '>' : '>='} ${schema.minimum}`;\n }\n if (schema.maximum !== undefined && schema.minimum !== undefined) {\n range = `${schema.minimum} ${exclusiveMinimum ? '<' : '<='} x ${exclusiveMaximum ? '<' : '<='} ${schema.maximum}`;\n }\n if (range === '' && schema.multipleOf === undefined) {\n return null;\n }\n return (\n <div className=\"mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert mint:mt-6\">\n {range && (\n <>\n Required range: <code>{range}</code>\n </>\n )}\n {schema.multipleOf && (\n <>\n Must be a multiple of <code>{schema.multipleOf}</code>\n </>\n )}\n </div>\n );\n};\n"],"names":["NumberMetadata","schema","exclusiveMinimum","exclusiveMaximum","range","jsxs","Fragment","jsx"],"mappings":";AAGO,MAAMA,IAAiB,CAAC,EAAE,QAAAC,QAAuC;AACtE,QAAMC,IAAmBD,EAAO,oBAAoBA,EAAO,qBAAqB,QAC1EE,IAAmBF,EAAO,oBAAoBA,EAAO,qBAAqB;AAChF,MAAIG,IAAQ;AAUZ,SATIH,EAAO,YAAY,WACrBG,IAAQ,KAAKD,IAAmB,MAAM,IAAI,IAAIF,EAAO,OAAO,KAE1DA,EAAO,YAAY,WACrBG,IAAQ,KAAKF,IAAmB,MAAM,IAAI,IAAID,EAAO,OAAO,KAE1DA,EAAO,YAAY,UAAaA,EAAO,YAAY,WACrDG,IAAQ,GAAGH,EAAO,OAAO,IAAIC,IAAmB,MAAM,IAAI,MAAMC,IAAmB,MAAM,IAAI,IAAIF,EAAO,OAAO,KAE7GG,MAAU,MAAMH,EAAO,eAAe,SACjC,OAGP,gBAAAI,EAAC,OAAA,EAAI,WAAU,6EACZ,UAAA;AAAA,IAAAD,KACC,gBAAAC,EAAAC,GAAA,EAAE,UAAA;AAAA,MAAA;AAAA,MACgB,gBAAAC,EAAC,UAAM,UAAAH,EAAA,CAAM;AAAA,IAAA,GAC/B;AAAA,IAEDH,EAAO,cACN,gBAAAI,EAAAC,GAAA,EAAE,UAAA;AAAA,MAAA;AAAA,MACsB,gBAAAC,EAAC,QAAA,EAAM,UAAAN,EAAO,WAAA,CAAW;AAAA,IAAA,EAAA,CACjD;AAAA,EAAA,GAEJ;AAEJ;"}
|
package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringMetadata.js","sources":["../../../../../src/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"StringMetadata.js","sources":["../../../../../src/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.tsx"],"sourcesContent":["\nimport { StringSchema } from '@mintlify/validation';\n\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nexport const StringMetadata = ({\n schema,\n description,\n}: {\n schema: StringSchema;\n description?: string;\n}) => {\n return (\n <>\n {schema.const !== undefined && (\n <div className={cn('mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert', description && 'mint:mt-6')}>\n Allowed value: <code>{`\"${schema.const}\"`}</code>\n </div>\n )}\n {(schema.minLength !== undefined || schema.maxLength !== undefined) && (\n <div className={cn('mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert', description && 'mint:mt-6')}>\n <StringLength minLength={schema.minLength} maxLength={schema.maxLength} />\n </div>\n )}\n </>\n );\n};\n\nconst StringLength = ({ minLength, maxLength }: { minLength?: number; maxLength?: number }) => {\n if (minLength === maxLength && minLength !== undefined) {\n return (\n <>\n Required string length: <code>{minLength}</code>\n </>\n );\n }\n if (minLength && maxLength) {\n return (\n <>\n Required string length: <code>{`${minLength} - ${maxLength}`}</code>\n </>\n );\n }\n if (minLength) {\n return (\n <>\n Minimum length: <code>{minLength}</code>\n </>\n );\n }\n if (maxLength) {\n return (\n <>\n Maximum length: <code>{maxLength}</code>\n </>\n );\n }\n return '';\n};\n"],"names":["StringMetadata","schema","description","jsxs","Fragment","cn","jsx","StringLength","minLength","maxLength"],"mappings":";;;AAKO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,QAAAC;AAAA,EACA,aAAAC;AACF,MAKI,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,EAAAH,EAAO,UAAU,UAChB,gBAAAE,EAAC,OAAA,EAAI,WAAWE,EAAG,mEAAmEH,KAAe,WAAW,GAAG,UAAA;AAAA,IAAA;AAAA,IAClG,gBAAAI,EAAC,QAAA,EAAM,UAAA,IAAIL,EAAO,KAAK,IAAA,CAAI;AAAA,EAAA,GAC5C;AAAA,GAEAA,EAAO,cAAc,UAAaA,EAAO,cAAc,WACvD,gBAAAK,EAAC,OAAA,EAAI,WAAWD,EAAG,mEAAmEH,KAAe,WAAW,GAC9G,4BAACK,GAAA,EAAa,WAAWN,EAAO,WAAW,WAAWA,EAAO,UAAA,CAAW,EAAA,CAC1E;AAAA,GAEJ,GAIEM,IAAe,CAAC,EAAE,WAAAC,GAAW,WAAAC,QAC7BD,MAAcC,KAAaD,MAAc,SAEzC,gBAAAL,EAAAC,GAAA,EAAE,UAAA;AAAA,EAAA;AAAA,EACwB,gBAAAE,EAAC,UAAM,UAAAE,EAAA,CAAU;AAAA,GAC3C,IAGAA,KAAaC,IAEb,gBAAAN,EAAAC,GAAA,EAAE,UAAA;AAAA,EAAA;AAAA,oBACyB,QAAA,EAAM,UAAA,GAAGI,CAAS,MAAMC,CAAS,GAAA,CAAG;AAAA,GAC/D,IAGAD,IAEA,gBAAAL,EAAAC,GAAA,EAAE,UAAA;AAAA,EAAA;AAAA,EACgB,gBAAAE,EAAC,UAAM,UAAAE,EAAA,CAAU;AAAA,GACnC,IAGAC,IAEA,gBAAAN,EAAAC,GAAA,EAAE,UAAA;AAAA,EAAA;AAAA,EACgB,gBAAAE,EAAC,UAAM,UAAAG,EAAA,CAAU;AAAA,GACnC,IAGG;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.tsx"],"sourcesContent":["\nimport {\n AnySchema,\n BooleanSchema,\n DataSchema,\n DataSchemaArray,\n FileSchema,\n IncrementalDataSchema,\n IncrementalDataSchemaArray,\n NullSchema,\n NumberEnumSchema,\n NumberSchema,\n StringEnumSchema,\n StringSchema,\n} from '@mintlify/validation';\n\nimport { ParamHead } from '@/components/Api/Param';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { Description } from '../../components/Description';\nimport { ExampleDescription } from '../ExampleDescription';\nimport { EnumConstTable, EnumOptions } from './Enum';\nimport { NumberMetadata } from './NumberMetadata';\nimport { StringMetadata } from './StringMetadata';\nimport { FieldType } from '@/api-playground-2/types/api';\n\nexport type PrimitiveParamFieldParams = {\n fieldType: FieldType;\n schema:\n | BooleanSchema\n | StringSchema\n | NumberSchema\n | StringEnumSchema\n | NumberEnumSchema\n | FileSchema\n | NullSchema\n | AnySchema;\n schemaArray?: DataSchemaArray | IncrementalDataSchemaArray;\n typeOptions: string[];\n name?: string | null;\n location?: string;\n selectedIndex?: number;\n onSelectTypeOption?: (index: number) => void;\n parentName?: string;\n paramId?: string;\n style?: string;\n explode?: boolean;\n};\n\nexport const PrimitiveParamField = ({\n fieldType,\n schema,\n schemaArray,\n name,\n location,\n typeOptions,\n selectedIndex,\n onSelectTypeOption,\n parentName,\n paramId,\n style,\n explode,\n}: PrimitiveParamFieldParams) => {\n const typeLabel = typeOptions[selectedIndex ?? 0];\n\n const description =\n schema.description ??\n (name === undefined ? `The ${fieldType} is of type \\`${typeLabel}\\`.` : undefined);\n\n return (\n <div className=\"mint:py-6\">\n <ParamHead\n id={paramId}\n name={name}\n typeLabel={typeLabel}\n location={location}\n fieldType={fieldType}\n required={schema.required}\n deprecated={schema.deprecated}\n defaultValue={schema.default}\n typeOptions={typeOptions}\n selectedTypeOptionIndex={selectedIndex}\n onSelectTypeOption={onSelectTypeOption}\n parentName={parentName}\n style={style}\n explode={explode}\n />\n <div className={cn({ 'mint:mt-4': description || isEnum(schema) })}>\n {description && <Description markdown={description} />}\n {schemaArray && isEnumWithConsts(schemaArray) ? (\n <EnumConstTable schemaArray={schemaArray} />\n ) : (\n isEnum(schema) && <EnumOptions schema={schema} />\n )}\n {isStringSchema(schema) && <StringMetadata schema={schema} description={description} />}\n {isNumberSchema(schema) && <NumberMetadata schema={schema} />}\n <ExampleDescription schema={schema} />\n </div>\n </div>\n );\n};\n\nexport const isEnum = (\n schema: DataSchema | IncrementalDataSchema\n): schema is NumberEnumSchema | StringEnumSchema => {\n return (\n schema.type === 'enum<integer>' ||\n schema.type === 'enum<number>' ||\n schema.type === 'enum<string>'\n );\n};\n\nexport const isEnumWithConsts = (\n schemaArray?: DataSchemaArray | IncrementalDataSchemaArray\n): boolean => {\n if (!schemaArray) return false;\n return schemaArray.some((schema) => isEnum(schema) && 'const' in schema);\n};\n\nconst isStringSchema = (schema: DataSchema | IncrementalDataSchema): schema is StringSchema => {\n return schema.type === 'string';\n};\n\nconst isNumberSchema = (schema: DataSchema | IncrementalDataSchema): schema is NumberSchema => {\n return schema.type === 'number' || schema.type === 'integer';\n};\n"],"names":["isEnum","schema"],"mappings":";AAsGO,MAAMA,IAAS,CACpBC,MAGEA,EAAO,SAAS,mBAChBA,EAAO,SAAS,kBAChBA,EAAO,SAAS;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecursiveParamField.js","sources":["../../../../src/api-playground/EndpointFields/ParamFields/RecursiveParamField.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"RecursiveParamField.js","sources":["../../../../src/api-playground/EndpointFields/ParamFields/RecursiveParamField.tsx"],"sourcesContent":["\nimport { DataSchema, DataSchemaArray, IncrementalDataSchemaArray } from '@mintlify/validation';\nimport slugify from '@sindresorhus/slugify';\n\nimport { useEndpointLocation } from '@/contexts/EndpointLocationContext';\nimport { getConstFilteredSchemaArray } from '@/openapi/filterEnums';\nimport {\n getAuthFilteredSchemaArray,\n isDataSchemaArrayOrIncrementalDataSchemaArray,\n} from '@/openapi/getAuthFilteredSchemaArray';\nimport { getNextPropertiesByType } from '@/utils/api-reference/getNextPropertiesByType';\n\nimport { RecursiveParamFieldWithChildrenObserver } from './RecursiveParamFieldWithChildrenObserver';\nimport { RecursiveParamFieldWithObserver } from './RecursiveParamFieldWithObserver';\nimport { FieldType, RenderedRefs } from '@/api-playground-2/types/api';\n\nexport type RecursiveParamFieldParams = {\n fieldType: FieldType;\n schemaArray: DataSchemaArray | IncrementalDataSchemaArray;\n renderedRefs?: RenderedRefs;\n name?: string | null;\n location?: string;\n parentName?: string;\n depth?: number;\n hideDescription?: boolean;\n circularRefs?: string[];\n paramId?: string;\n style?: string;\n explode?: boolean;\n};\n\nexport const RecursiveParamField = ({\n fieldType,\n schemaArray,\n name,\n location,\n parentName,\n depth = 0,\n hideDescription = false,\n renderedRefs = new Set(),\n circularRefs,\n paramId,\n style,\n explode,\n}: RecursiveParamFieldParams) => {\n const { anchor } = useEndpointLocation();\n let filteredSchemaArray: DataSchemaArray | IncrementalDataSchemaArray | null = schemaArray;\n filteredSchemaArray = getAuthFilteredSchemaArray({ schemaArray, userGroups: undefined });\n\n if (\n filteredSchemaArray &&\n filteredSchemaArray.some((schema) => 'enum' in schema && 'const' in schema)\n ) {\n filteredSchemaArray = getConstFilteredSchemaArray({ schemaArray });\n }\n\n if (!isDataSchemaArrayOrIncrementalDataSchemaArray(filteredSchemaArray)) {\n return null;\n }\n\n const RecursiveParamFieldType = anchor\n ? RecursiveParamFieldWithChildrenObserver\n : RecursiveParamFieldWithObserver;\n\n return (\n <RecursiveParamFieldType\n fieldType={fieldType}\n schemaArray={filteredSchemaArray}\n name={name}\n location={location}\n parentName={parentName}\n depth={depth}\n style={style}\n explode={explode}\n hideDescription={hideDescription}\n renderedRefs={renderedRefs}\n circularRefs={circularRefs}\n paramId={paramId}\n />\n );\n};\n\ntype RenderNextPropertiesRecursivelyParams = {\n properties: [string, DataSchemaArray | IncrementalDataSchemaArray][];\n fieldType: FieldType;\n depth: number;\n refs: Set<string>;\n parentName?: string;\n name?: string | null;\n currentSchemaRef: string | undefined;\n style?: string;\n explode?: boolean;\n hideParentName?: boolean;\n};\n\nexport const renderNextPropertiesRecursively = ({\n currentSchemaRef,\n properties,\n fieldType,\n parentName,\n name,\n depth,\n refs,\n style,\n explode,\n hideParentName,\n}: RenderNextPropertiesRecursivelyParams) => {\n // Create a new set with the current refs for this level\n const currentLevelRefs = new Set(refs);\n\n if (currentSchemaRef) {\n currentLevelRefs.add(currentSchemaRef);\n }\n\n if (currentLevelRefs.size > 0) {\n return properties.map((property) => {\n const [propertyName, schemaArray] = property;\n const nextSchemaArray = schemaArray[0];\n const nextSchemaArrayProperties = getNextPropertiesByType(nextSchemaArray);\n const paramId = buildRecursiveParamFieldId(fieldType, name, parentName, propertyName);\n const passedName = hideParentName ? '' : name;\n let circularReferences: string[] = [];\n if (\n Object.values(nextSchemaArrayProperties).some(\n (value: unknown) => typeof value === 'string' && currentLevelRefs.has(value)\n )\n ) {\n circularReferences = Object.values(nextSchemaArrayProperties).filter(\n (value: unknown) => typeof value === 'string' && currentLevelRefs.has(value)\n );\n }\n return (\n <RecursiveParamField\n paramId={paramId}\n fieldType={fieldType}\n key={propertyName}\n schemaArray={schemaArray}\n name={propertyName}\n parentName={\n style === 'deepObject' && explode\n ? getDeepObjectParentName(passedName, parentName)\n : getRecursiveParentName(passedName, parentName)\n }\n depth={depth + 1}\n renderedRefs={new Set(currentLevelRefs)}\n circularRefs={circularReferences}\n style={style}\n explode={explode}\n />\n );\n });\n } else {\n return properties.map(([propertyName, schemaArray]) => {\n const paramId = buildRecursiveParamFieldId(fieldType, name, parentName, propertyName);\n const passedName = hideParentName ? '' : name;\n return (\n <RecursiveParamField\n paramId={paramId}\n fieldType={fieldType}\n key={propertyName}\n schemaArray={schemaArray}\n name={propertyName}\n parentName={\n style === 'deepObject' && explode\n ? getDeepObjectParentName(passedName, parentName)\n : getRecursiveParentName(passedName, parentName)\n }\n depth={depth + 1}\n renderedRefs={new Set()}\n style={style}\n explode={explode}\n />\n );\n });\n }\n};\n\ntype RenderTruncatedNextPropertiesParams = {\n properties: [string, DataSchemaArray | IncrementalDataSchemaArray][];\n fieldType: FieldType;\n parentName?: string;\n name?: string | null;\n depth: number;\n};\n\nexport const renderTruncatedNextProperties = ({\n properties,\n fieldType,\n parentName,\n name,\n depth,\n}: RenderTruncatedNextPropertiesParams) => {\n return properties.map((property) => {\n const [propertyName, schemaArray] = property;\n const nextSchemaArray = schemaArray[0];\n const baseSchema: DataSchema = nextSchemaArray as DataSchema;\n if (baseSchema.type === 'array') {\n baseSchema.items = [{ type: 'any' }];\n } else if (baseSchema.type === 'object') {\n baseSchema.properties = {};\n }\n const paramId = buildRecursiveParamFieldId(fieldType, name, parentName);\n const id = `${paramId}-${propertyName}`;\n return (\n <RecursiveParamField\n fieldType={fieldType}\n key={propertyName}\n schemaArray={[baseSchema]}\n name={propertyName}\n paramId={id}\n depth={depth + 1}\n renderedRefs={new Set()}\n />\n );\n });\n};\n\nexport const buildRecursiveParamFieldId = (\n fieldType: FieldType | undefined,\n name: string | undefined | null,\n parentName: string | undefined,\n propertyName?: string | undefined\n) => {\n return slugify(\n `${fieldType ? `${fieldType}-` : ''}${parentName ? `${parentName}-` : ''}${name ? name : ''}-${propertyName ? propertyName : ''}`,\n {\n decamelize: true,\n }\n );\n};\n\nexport const getRecursiveParentName = (name?: string | null, parentName?: string): string => {\n if (!name) {\n return '';\n }\n\n return `${parentName ? `${parentName}` : ''}${name}.`;\n};\n\nexport const getDeepObjectParentName = (name?: string | null, parentName?: string): string => {\n if (!name) {\n return '';\n }\n\n return parentName ? `${parentName}${name}][` : `${name}[`;\n};\n"],"names":["buildRecursiveParamFieldId","fieldType","name","parentName","propertyName","slugify","getRecursiveParentName"],"mappings":";;AAyNO,MAAMA,IAA6B,CACxCC,GACAC,GACAC,GACAC,MAEOC;AAAA,EACL,GAAGJ,IAAY,GAAGA,CAAS,MAAM,EAAE,GAAGE,IAAa,GAAGA,CAAU,MAAM,EAAE,GAAGD,KAAc,EAAE;AAAA,EAC3F;AAAA,IACE,YAAY;AAAA,EAAA;AACd,GAISI,IAAyB,CAACJ,GAAsBC,MACtDD,IAIE,GAAGC,IAAa,GAAGA,CAAU,KAAK,EAAE,GAAGD,CAAI,MAHzC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Description.js","sources":["../../../../src/api-playground/EndpointFields/components/Description.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"Description.js","sources":["../../../../src/api-playground/EndpointFields/components/Description.tsx"],"sourcesContent":["\nimport { Markdown, MarkdownWithoutHeaders } from '../../../components/Api/Markdown';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nexport const Description = ({ markdown, className }: { markdown: string; className?: string }) => {\n return (\n <div className={cn('mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert mint:max-w-none mint:w-full mint:col-span-full', className)}>\n <Markdown>{markdown}</Markdown>\n </div>\n );\n};\n\nexport const DescriptionWithoutHeaders = ({\n markdown,\n className,\n}: {\n markdown: string;\n className?: string;\n}) => {\n return (\n <div className={cn('mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert mint:max-w-none mint:w-full', className)}>\n <MarkdownWithoutHeaders>{markdown}</MarkdownWithoutHeaders>\n </div>\n );\n};\n"],"names":["Description","markdown","className","jsx","cn","Markdown","DescriptionWithoutHeaders","MarkdownWithoutHeaders"],"mappings":";;;;AAIO,MAAMA,IAAc,CAAC,EAAE,UAAAC,GAAU,WAAAC,QAEpC,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAG,kHAAkHF,CAAS,GAC5I,UAAA,gBAAAC,EAACE,GAAA,EAAU,UAAAJ,EAAA,CAAS,EAAA,CACtB,GAISK,IAA4B,CAAC;AAAA,EACxC,UAAAL;AAAA,EACA,WAAAC;AACF,MAKI,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAG,+FAA+FF,CAAS,GACzH,UAAA,gBAAAC,EAACI,GAAA,EAAwB,UAAAN,EAAA,CAAS,EAAA,CACpC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OneOfDropdown.js","sources":["../../../../src/api-playground/EndpointFields/components/OneOfDropdown.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"OneOfDropdown.js","sources":["../../../../src/api-playground/EndpointFields/components/OneOfDropdown.tsx"],"sourcesContent":["\nimport { Tab, Tabs } from '@/components/content-components/tabs';\nimport { cn } from \"../../../utils/cn\";\n\nexport const OneOfSelection = ({\n options,\n selectedIndex,\n onSelectOption,\n}: {\n options: string[];\n selectedIndex?: number;\n onSelectOption?: (index: number) => void;\n}) => (\n <div className=\"mint:-mt-2\">\n <Tabs\n defaultTabIndex={selectedIndex}\n onClickTab={onSelectOption}\n className=\"mint:border-gray-100! mint:mb-4! mint:dark:border-white/10!\"\n >\n {options.map((option) => (\n <Tab title={option} key={option} />\n ))}\n </Tabs>\n </div>\n);\n"],"names":["OneOfSelection","options","selectedIndex","onSelectOption","jsx","Tabs","option","Tab"],"mappings":";;;AAIO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AACF,MAKE,gBAAAC,EAAC,OAAA,EAAI,WAAU,cACb,UAAA,gBAAAA;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,iBAAiBH;AAAA,IACjB,YAAYC;AAAA,IACZ,WAAU;AAAA,IAET,UAAAF,EAAQ,IAAI,CAACK,wBACXC,GAAA,EAAI,OAAOD,EAAA,GAAaA,CAAQ,CAClC;AAAA,EAAA;AACH,EAAA,CACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionDropdown.js","sources":["../../../../src/api-playground/EndpointFields/components/OptionDropdown.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"OptionDropdown.js","sources":["../../../../src/api-playground/EndpointFields/components/OptionDropdown.tsx"],"sourcesContent":["\nimport { useSelectedLocale } from '@/utils/locales';\nimport { Classes } from '@/api-playground-2/types';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nexport const OptionDropdown = ({\n options,\n selectedIndex,\n onSelectOption,\n noBackground,\n}: {\n options: string[];\n selectedIndex?: number;\n onSelectOption?: (index: number) => void;\n noBackground?: boolean;\n}) => {\n const locale = useSelectedLocale();\n return (\n <div className={cn(Classes.OptionDropdown, 'mint:inline-flex mint:relative mint:mr-0!')}>\n <div\n className={cn(\n 'mint:font-mono mint:text-xs mint:font-medium mint:inline-block! mint:leading-4! mint:items-center mint:rounded-md mint:text-gray-600 mint:dark:text-gray-200 mint:py-0.5',\n !noBackground && 'mint:bg-gray-100/50 mint:dark:bg-white/5'\n )}\n >\n <select\n aria-label={locale['aria.selectSchemaType']}\n className=\"mint:flex mint:bg-transparent mint:focus:outline-0 mint:cursor-pointer mint:text-start mint:pl-0 mint:pr-0 mint:hover:text-gray-950 mint:dark:hover:text-white\"\n onChange={(e) => onSelectOption?.(e.target.selectedIndex)}\n value={selectedIndex}\n >\n {options.map((option, index) => (\n <option value={index} key={index}>\n {option}\n </option>\n ))}\n </select>\n </div>\n </div>\n );\n};\n"],"names":["OptionDropdown","options","selectedIndex","onSelectOption","noBackground","locale","useSelectedLocale","cn","Classes","jsx","e","option","index"],"mappings":";;;;;AAKO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,cAAAC;AACF,MAKM;AACJ,QAAMC,IAASC,EAAA;AACf,2BACG,OAAA,EAAI,WAAWC,EAAGC,EAAQ,gBAAgB,2CAA2C,GACpF,UAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWF;AAAA,QACT;AAAA,QACA,CAACH,KAAgB;AAAA,MAAA;AAAA,MAGnB,UAAA,gBAAAK;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,cAAYJ,EAAO,uBAAuB;AAAA,UAC1C,WAAU;AAAA,UACV,UAAU,CAACK,MAAMP,KAAA,gBAAAA,EAAiBO,EAAE,OAAO;AAAA,UAC3C,OAAOR;AAAA,UAEN,UAAAD,EAAQ,IAAI,CAACU,GAAQC,MACpB,gBAAAH,EAAC,UAAA,EAAO,OAAOG,GACZ,UAAAD,EAAA,GADwBC,CAE3B,CACD;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeading.js","sources":["../../../../src/api-playground/EndpointFields/components/SectionHeading.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"SectionHeading.js","sources":["../../../../src/api-playground/EndpointFields/components/SectionHeading.tsx"],"sourcesContent":["\nimport { ReactNode } from 'react';\n\nimport { Classes } from '@/api-playground-2/types';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { Description } from './Description';\nimport { OptionDropdown } from './OptionDropdown';\n\ntype SectionHeadingProps = {\n title: string;\n subtitle?: string;\n rightElement?: string | ReactNode;\n options?: string[];\n selectedIndex?: number;\n onSelectOption?: (index: number) => void;\n onToggleExpand?: () => void;\n children?: ReactNode;\n};\n\nexport const SectionHeading = ({\n title,\n subtitle,\n rightElement,\n options,\n selectedIndex,\n onSelectOption,\n children,\n}: SectionHeadingProps) => {\n return (\n <div className={cn(Classes.APISectionHeading, 'mint:flex mint:flex-col mint:gap-y-4 mint:w-full')}>\n <div className=\"mint:flex mint:items-baseline mint:border-b mint:pb-2.5 mint:border-gray-100 mint:dark:border-gray-800 mint:w-full\">\n <h4 className={cn(Classes.APISectionHeadingTitle, 'mint:flex-1 mint:mb-0')}>{title}</h4>\n {options && options.length > 1 && (\n <OptionDropdown\n options={options}\n selectedIndex={selectedIndex}\n onSelectOption={onSelectOption}\n noBackground\n />\n )}\n <div className=\"mint:flex mint:items-center\">\n {rightElement &&\n (typeof rightElement === 'string' ? (\n <div className=\"mint:font-mono mint:px-2 mint:py-0.5 mint:text-xs mint:font-medium mint:text-gray-600 mint:dark:text-gray-300\">\n {rightElement}\n </div>\n ) : (\n rightElement\n ))}\n </div>\n </div>\n {children}\n {subtitle && (\n <div\n className={cn(\n Classes.APISectionHeadingSubtitle,\n 'mint:text-sm mint:prose mint:prose-gray mint:dark:prose-invert mint:mb-2'\n )}\n >\n <Description markdown={subtitle} />\n </div>\n )}\n </div>\n );\n};\n"],"names":["SectionHeading","title","subtitle","rightElement","options","selectedIndex","onSelectOption","children","cn","Classes","jsxs","jsx","OptionDropdown","Description"],"mappings":";;;;;;AAoBO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AACF,wBAEK,OAAA,EAAI,WAAWC,EAAGC,EAAQ,mBAAmB,kDAAkD,GAC9F,UAAA;AAAA,EAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,sHACb,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAG,WAAWH,EAAGC,EAAQ,wBAAwB,uBAAuB,GAAI,UAAAR,GAAM;AAAA,IAClFG,KAAWA,EAAQ,SAAS,KAC3B,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,SAAAR;AAAA,QACA,eAAAC;AAAA,QACA,gBAAAC;AAAA,QACA,cAAY;AAAA,MAAA;AAAA,IAAA;AAAA,IAGhB,gBAAAK,EAAC,OAAA,EAAI,WAAU,+BACZ,gBACE,OAAOR,KAAiB,WACvB,gBAAAQ,EAAC,OAAA,EAAI,WAAU,iHACZ,UAAAR,EAAA,CACH,IAEAA,GAAA,CAEN;AAAA,EAAA,GACF;AAAA,EACCI;AAAA,EACAL,KACC,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWH;AAAA,QACTC,EAAQ;AAAA,QACR;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAE,EAACE,GAAA,EAAY,UAAUX,EAAA,CAAU;AAAA,IAAA;AAAA,EAAA;AACnC,GAEJ;"}
|