@mintlify/msft-sdk 1.1.22 → 1.1.24
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/Request/BodySection.js +65 -0
- package/dist/api-playground/ApiPlayground/Request/BodySection.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/ParameterSection.js +33 -0
- package/dist/api-playground/ApiPlayground/Request/ParameterSection.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js +201 -0
- package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/SecuritySection.js +147 -0
- package/dist/api-playground/ApiPlayground/Request/SecuritySection.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/ServerSection.js +31 -0
- package/dist/api-playground/ApiPlayground/Request/ServerSection.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/index.js +44 -0
- package/dist/api-playground/ApiPlayground/Request/index.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js +94 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js +91 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js +63 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js +34 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js +62 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js +110 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js +88 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js +62 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js +55 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js +68 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js +45 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/CopyFileToClipboardButton.js +7 -0
- package/dist/api-playground/ApiPlayground/Response/CopyFileToClipboardButton.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/DownloadFileButton.js +45 -0
- package/dist/api-playground/ApiPlayground/Response/DownloadFileButton.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js +54 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/index.js +15 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/index.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseError.js +14 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseError.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseHeaders.js +12 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseHeaders.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js +20 -0
- package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseTable.js +21 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseTable.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js +93 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/index.js +80 -0
- package/dist/api-playground/ApiPlayground/Response/index.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/AdditionalItemButton.js +24 -0
- package/dist/api-playground/ApiPlayground/components/AdditionalItemButton.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js +45 -0
- package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/ArrayCount.js +18 -0
- package/dist/api-playground/ApiPlayground/components/ArrayCount.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/BasePathSelector.js +40 -0
- package/dist/api-playground/ApiPlayground/components/BasePathSelector.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js +44 -0
- package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js +45 -0
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js +39 -0
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/InputContainer.js +129 -0
- package/dist/api-playground/ApiPlayground/components/InputContainer.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js +60 -0
- package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/ModalHeader.js +16 -0
- package/dist/api-playground/ApiPlayground/components/ModalHeader.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/ObjectExpandButton.js +29 -0
- package/dist/api-playground/ApiPlayground/components/ObjectExpandButton.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/ParamFieldWrapper.js +20 -0
- package/dist/api-playground/ApiPlayground/components/ParamFieldWrapper.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/PathHeader.js +163 -0
- package/dist/api-playground/ApiPlayground/components/PathHeader.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js +59 -0
- package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/PrettyPath.js +50 -0
- package/dist/api-playground/ApiPlayground/components/PrettyPath.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/SendPill.js +40 -0
- package/dist/api-playground/ApiPlayground/components/SendPill.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/TrashButton.js +27 -0
- package/dist/api-playground/ApiPlayground/components/TrashButton.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/TypeDropdown.js +53 -0
- package/dist/api-playground/ApiPlayground/components/TypeDropdown.js.map +1 -0
- package/dist/api-playground/ApiPlayground/index.js +68 -0
- package/dist/api-playground/ApiPlayground/index.js.map +1 -0
- package/dist/api-playground/EndpointFields/ParamFields/ExampleDescription.js +51 -0
- package/dist/api-playground/EndpointFields/ParamFields/ExampleDescription.js.map +1 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js +20 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js.map +1 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js +19 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js.map +1 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js +29 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js.map +1 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js +6 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js.map +1 -0
- package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js +13 -0
- package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js.map +1 -0
- package/dist/api-playground/EndpointFields/components/Description.js +13 -0
- package/dist/api-playground/EndpointFields/components/Description.js.map +1 -0
- package/dist/api-playground/EndpointFields/components/OneOfDropdown.js +20 -0
- package/dist/api-playground/EndpointFields/components/OneOfDropdown.js.map +1 -0
- package/dist/api-playground/EndpointFields/components/OptionDropdown.js +36 -0
- package/dist/api-playground/EndpointFields/components/OptionDropdown.js.map +1 -0
- package/dist/api-playground/EndpointFields/components/SectionHeading.js +44 -0
- package/dist/api-playground/EndpointFields/components/SectionHeading.js.map +1 -0
- package/dist/api-playground/EndpointFields/index.js +7 -0
- package/dist/api-playground/EndpointFields/index.js.map +1 -0
- package/dist/api-playground-2/Api.js +13 -0
- package/dist/api-playground-2/Api.js.map +1 -0
- package/dist/api-playground-2/ApiExamples.js +27 -18
- package/dist/api-playground-2/ApiExamples.js.map +1 -1
- package/dist/api-playground-2/ApiFields.js +253 -0
- package/dist/api-playground-2/ApiFields.js.map +1 -0
- package/dist/api-playground-2/EndpointHeader.js +52 -0
- package/dist/api-playground-2/EndpointHeader.js.map +1 -0
- package/dist/api-playground-2/OperationPage.js +101 -0
- package/dist/api-playground-2/OperationPage.js.map +1 -0
- package/dist/api-playground-2/Playground.js +136 -0
- package/dist/api-playground-2/Playground.js.map +1 -0
- package/dist/api-playground-2/SchemaPage.js +14 -0
- package/dist/api-playground-2/SchemaPage.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js +88 -0
- package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/Enum.js +16 -0
- package/dist/api-playground-2/components/EndpointFields/fields/Enum.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/NumberMetadata.js +21 -0
- package/dist/api-playground-2/components/EndpointFields/fields/NumberMetadata.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js +57 -0
- package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js +90 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js +122 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js +75 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js +253 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/StringMetadata.js +28 -0
- package/dist/api-playground-2/components/EndpointFields/fields/StringMetadata.js.map +1 -0
- package/dist/api-playground-2/components/Example/GeneratedRequestExample.js +113 -118
- package/dist/api-playground-2/components/Example/GeneratedRequestExample.js.map +1 -1
- package/dist/api-playground-2/components/Example/RequestExample.js +55 -50
- package/dist/api-playground-2/components/Example/RequestExample.js.map +1 -1
- package/dist/api-playground-2/components/Request/BodySection.js +41 -0
- package/dist/api-playground-2/components/Request/BodySection.js.map +1 -0
- package/dist/api-playground-2/components/Request/InputSectionContainer.js +66 -0
- package/dist/api-playground-2/components/Request/InputSectionContainer.js.map +1 -0
- package/dist/api-playground-2/components/Request/ParameterSection.js +36 -0
- package/dist/api-playground-2/components/Request/ParameterSection.js.map +1 -0
- package/dist/api-playground-2/components/Request/SecuritySection.js +55 -0
- package/dist/api-playground-2/components/Request/SecuritySection.js.map +1 -0
- package/dist/api-playground-2/components/Request/ServerSection.js +33 -0
- package/dist/api-playground-2/components/Request/ServerSection.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/ArrayInput.js +55 -0
- package/dist/api-playground-2/components/Request/inputs/ArrayInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/DifferentiatedInput.js +48 -0
- package/dist/api-playground-2/components/Request/inputs/DifferentiatedInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/FileInput.js +43 -0
- package/dist/api-playground-2/components/Request/inputs/FileInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/InputContainer.js +127 -0
- package/dist/api-playground-2/components/Request/inputs/InputContainer.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/NullInput.js +15 -0
- package/dist/api-playground-2/components/Request/inputs/NullInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/NumberInput.js +46 -0
- package/dist/api-playground-2/components/Request/inputs/NumberInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/ObjectInput.js +104 -0
- package/dist/api-playground-2/components/Request/inputs/ObjectInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/OneOfInput.js +77 -0
- package/dist/api-playground-2/components/Request/inputs/OneOfInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/SelectInput.js +54 -0
- package/dist/api-playground-2/components/Request/inputs/SelectInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/StringInput.js +44 -0
- package/dist/api-playground-2/components/Request/inputs/StringInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/TextInput.js +29 -0
- package/dist/api-playground-2/components/Request/inputs/TextInput.js.map +1 -0
- package/dist/api-playground-2/components/TypeDropdown.js +48 -0
- package/dist/api-playground-2/components/TypeDropdown.js.map +1 -0
- package/dist/api-playground-2/constants/index.js +6 -4
- package/dist/api-playground-2/constants/index.js.map +1 -1
- package/dist/api-playground-2/contexts/ApiPlaygroundContext.js +11 -0
- package/dist/api-playground-2/contexts/ApiPlaygroundContext.js.map +1 -0
- package/dist/api-playground-2/generators/createBodyData.js +1 -1
- package/dist/api-playground-2/generators/createBodyData.js.map +1 -1
- package/dist/api-playground-2/generators/createHeaders.js +18 -18
- package/dist/api-playground-2/generators/createHeaders.js.map +1 -1
- package/dist/api-playground-2/generators/generateInteractiveCodeSample.js +21 -19
- package/dist/api-playground-2/generators/generateInteractiveCodeSample.js.map +1 -1
- package/dist/api-playground-2/generators/generateRequest.js +26 -25
- package/dist/api-playground-2/generators/generateRequest.js.map +1 -1
- package/dist/api-playground-2/generators/generateSnippet.js +187 -36
- package/dist/api-playground-2/generators/generateSnippet.js.map +1 -1
- package/dist/api-playground-2/generators/generateSnippetMap.js +13 -11
- package/dist/api-playground-2/generators/generateSnippetMap.js.map +1 -1
- package/dist/api-playground-2/hooks/useCopyPathWithInputs.js +14 -0
- package/dist/api-playground-2/hooks/useCopyPathWithInputs.js.map +1 -0
- package/dist/api-playground-2/hooks/useInitializeInputs.js +101 -0
- package/dist/api-playground-2/hooks/useInitializeInputs.js.map +1 -0
- package/dist/api-playground-2/hooks/usePlaygroundInputsStore.js +24 -13
- package/dist/api-playground-2/hooks/usePlaygroundInputsStore.js.map +1 -1
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +156 -0
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js +57 -0
- package/dist/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/processExamples.js +41 -8
- package/dist/api-playground-2/schemaGraph/processExamples.js.map +1 -1
- package/dist/api-playground-2/schemaGraph/processSecurityOptions.js +107 -0
- package/dist/api-playground-2/schemaGraph/processSecurityOptions.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/utils.js +195 -43
- package/dist/api-playground-2/schemaGraph/utils.js.map +1 -1
- package/dist/api-playground-2/types/index.js +118 -0
- package/dist/api-playground-2/types/index.js.map +1 -0
- package/dist/common/guards.js +37 -0
- package/dist/common/guards.js.map +1 -0
- package/dist/common/potentiallyParseOpenApiString.js +25 -0
- package/dist/common/potentiallyParseOpenApiString.js.map +1 -0
- package/dist/common/replaceSlashIndex.js +7 -0
- package/dist/common/replaceSlashIndex.js.map +1 -0
- package/dist/common/slugToTitle.js +11 -0
- package/dist/common/slugToTitle.js.map +1 -0
- package/dist/components/Api/Expandable.js +119 -0
- package/dist/components/Api/Expandable.js.map +1 -0
- package/dist/components/Api/Markdown.js +66 -0
- package/dist/components/Api/Markdown.js.map +1 -0
- package/dist/components/Api/Param.js +191 -0
- package/dist/components/Api/Param.js.map +1 -0
- package/dist/components/content-components/code-block.js +68 -61
- package/dist/components/content-components/code-block.js.map +1 -1
- package/dist/components/content-components/code-group.js +36 -25
- package/dist/components/content-components/code-group.js.map +1 -1
- package/dist/components/content-components/getNodeText.js +5 -0
- package/dist/components/content-components/getNodeText.js.map +1 -0
- package/dist/components/toc/index.js +4 -4
- package/dist/components/toc/index.js.map +1 -1
- package/dist/constants/index.js +5 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/zIndex.js +7 -0
- package/dist/constants/zIndex.js.map +1 -0
- package/dist/contexts/ApiPlaygroundInputsContext.js +18 -0
- package/dist/contexts/ApiPlaygroundInputsContext.js.map +1 -0
- package/dist/contexts/ConfigContext.js +2 -3
- package/dist/contexts/ConfigContext.js.map +1 -1
- package/dist/contexts/EndpointLocationContext.js +18 -0
- package/dist/contexts/EndpointLocationContext.js.map +1 -0
- package/dist/contexts/MDXContentContext.js +19 -0
- package/dist/contexts/MDXContentContext.js.map +1 -0
- package/dist/env.js +6 -1
- package/dist/env.js.map +1 -1
- package/dist/hooks/useApiPlaygroundInputs.js +7 -0
- package/dist/hooks/useApiPlaygroundInputs.js.map +1 -0
- package/dist/hooks/useApiPlaygroundPrefillExamples.js +40 -0
- package/dist/hooks/useApiPlaygroundPrefillExamples.js.map +1 -0
- package/dist/hooks/useBaseUrlOptions.js +19 -0
- package/dist/hooks/useBaseUrlOptions.js.map +1 -0
- package/dist/hooks/useCheckHash.js +18 -0
- package/dist/hooks/useCheckHash.js.map +1 -0
- package/dist/hooks/useComponentSchemas.js +10 -0
- package/dist/hooks/useComponentSchemas.js.map +1 -0
- package/dist/hooks/useCurrentPath.js +17 -0
- package/dist/hooks/useCurrentPath.js.map +1 -0
- package/dist/hooks/useEndpoint.js +3 -3
- package/dist/hooks/useExpandableMemory.js +46 -0
- package/dist/hooks/useExpandableMemory.js.map +1 -0
- package/dist/hooks/useGenerateNextAdditionalProperties.js +12 -0
- package/dist/hooks/useGenerateNextAdditionalProperties.js.map +1 -0
- package/dist/hooks/useGenerateNextItems.js +12 -0
- package/dist/hooks/useGenerateNextItems.js.map +1 -0
- package/dist/hooks/useGenerateNextProperties.js +12 -0
- package/dist/hooks/useGenerateNextProperties.js.map +1 -0
- package/dist/hooks/useKeyboardShortcut.js +26 -0
- package/dist/hooks/useKeyboardShortcut.js.map +1 -0
- package/dist/hooks/useMDXContent.js +7 -0
- package/dist/hooks/useMDXContent.js.map +1 -0
- package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js +10 -0
- package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js.map +1 -0
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js +16 -0
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js.map +1 -0
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js +16 -0
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js.map +1 -0
- package/dist/hooks/usePlaygroundSchemaOptions.js +43 -0
- package/dist/hooks/usePlaygroundSchemaOptions.js.map +1 -0
- package/dist/hooks/usePrefilledInputs/index.js +66 -0
- package/dist/hooks/usePrefilledInputs/index.js.map +1 -0
- package/dist/hooks/usePrefilledInputs/storedServerVariables.js +30 -0
- package/dist/hooks/usePrefilledInputs/storedServerVariables.js.map +1 -0
- package/dist/hooks/useSecurityOption.js +11 -0
- package/dist/hooks/useSecurityOption.js.map +1 -0
- package/dist/hooks/useSendPlaygroundRequest.js +146 -15
- package/dist/hooks/useSendPlaygroundRequest.js.map +1 -1
- package/dist/hooks/useSetDefaultValue.js +64 -0
- package/dist/hooks/useSetDefaultValue.js.map +1 -0
- package/dist/index.d.ts +281 -0
- package/dist/index.js +143 -108
- package/dist/index.js.map +1 -1
- package/dist/openapi/filterEnums.js +21 -0
- package/dist/openapi/filterEnums.js.map +1 -0
- package/dist/openapi/generateNextAdditionalProperties.js +8 -0
- package/dist/openapi/generateNextAdditionalProperties.js.map +1 -0
- package/dist/openapi/generateNextItems.js +8 -0
- package/dist/openapi/generateNextItems.js.map +1 -0
- package/dist/openapi/generateNextProperties.js +24 -0
- package/dist/openapi/generateNextProperties.js.map +1 -0
- package/dist/openapi/generateOptionLabels.js +21 -0
- package/dist/openapi/generateOptionLabels.js.map +1 -0
- package/dist/openapi/generateSimpleLabels.js +5 -0
- package/dist/openapi/generateSimpleLabels.js.map +1 -0
- package/dist/openapi/generateTypeStringFromSchema.js +34 -0
- package/dist/openapi/generateTypeStringFromSchema.js.map +1 -0
- package/dist/openapi/getAuthFilteredSchemaArray.js +19 -0
- package/dist/openapi/getAuthFilteredSchemaArray.js.map +1 -0
- package/dist/paths/isEqualIgnoringLeadingSlash.js +22 -0
- package/dist/paths/isEqualIgnoringLeadingSlash.js.map +1 -0
- package/dist/paths/optionallyRemoveLeadingSlash.js +7 -0
- package/dist/paths/optionallyRemoveLeadingSlash.js.map +1 -0
- package/dist/paths/optionallyRemoveTrailingSlash.js +7 -0
- package/dist/paths/optionallyRemoveTrailingSlash.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/utils/api-playground/defaults.js +16 -0
- package/dist/utils/api-playground/defaults.js.map +1 -0
- package/dist/utils/api-playground/paramFieldDefaults.js +11 -0
- package/dist/utils/api-playground/paramFieldDefaults.js.map +1 -0
- package/dist/utils/api-reference/getFilteredSecurityOptions.js +5 -0
- package/dist/utils/api-reference/getFilteredSecurityOptions.js.map +1 -0
- package/dist/utils/api-reference/getNextPropertiesByType.js +6 -0
- package/dist/utils/api-reference/getNextPropertiesByType.js.map +1 -0
- package/dist/utils/containsMarkdownTable.js +5 -0
- package/dist/utils/containsMarkdownTable.js.map +1 -0
- package/dist/utils/copyToClipboard.js +12 -0
- package/dist/utils/copyToClipboard.js.map +1 -0
- package/dist/utils/decodeSlug.js +8 -0
- package/dist/utils/decodeSlug.js.map +1 -0
- package/dist/utils/flattenObject.js +11 -0
- package/dist/utils/flattenObject.js.map +1 -0
- package/dist/utils/formatJSON.js +39 -0
- package/dist/utils/formatJSON.js.map +1 -0
- package/dist/utils/optionallyAddLeadingSlash.js +7 -0
- package/dist/utils/optionallyAddLeadingSlash.js.map +1 -0
- package/dist/utils/scrollElementIntoView.js +21 -0
- package/dist/utils/scrollElementIntoView.js.map +1 -0
- package/package.json +2 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiPlaygroundInputsContext.js","sources":["../../src/contexts/ApiPlaygroundInputsContext.tsx"],"sourcesContent":["import { ApiPlaygroundInputs } from '@mintlify/validation';\nimport { createContext, Reducer, useReducer } from 'react';\n\nexport const initialApiPlaygroundInputs: ApiPlaygroundInputs = {\n server: {},\n path: {},\n query: {},\n header: {},\n cookie: {},\n body: undefined,\n};\n\ntype ApiPlaygroundInputsAction = {\n type: 'set_api_playground_inputs';\n payload: ApiPlaygroundInputs;\n};\n\nexport const ApiPlaygroundInputsReducer: Reducer<ApiPlaygroundInputs, ApiPlaygroundInputsAction> = (\n state: ApiPlaygroundInputs,\n action\n) => {\n return {\n ...state,\n ...action.payload,\n server: Object.keys(action.payload.server).length\n ? {\n ...state.server,\n ...action.payload.server,\n }\n : {},\n path: Object.keys(action.payload.path).length\n ? {\n ...state.path,\n ...action.payload.path,\n }\n : {},\n query: Object.keys(action.payload.query).length\n ? {\n ...state.query,\n ...action.payload.query,\n }\n : {},\n header: Object.keys(action.payload.header).length\n ? {\n ...state.header,\n ...action.payload.header,\n }\n : {},\n cookie: Object.keys(action.payload.cookie).length\n ? {\n ...state.cookie,\n ...action.payload.cookie,\n }\n : {},\n body: action.payload.body\n ? typeof action.payload.body === 'object' && !Array.isArray(action.payload.body)\n ? {\n ...(state.body || {}),\n ...action.payload.body,\n }\n : action.payload.body\n : action.payload.body === ''\n ? undefined\n : state.body,\n };\n};\n\nexport const useApiPlaygroundInputsReducer = (state: ApiPlaygroundInputs) =>\n useReducer(ApiPlaygroundInputsReducer, { ...initialApiPlaygroundInputs, ...state });\n\nexport type ApiPlaygroundInputsContextType = ReturnType<typeof useApiPlaygroundInputsReducer>;\n\nexport const ApiPlaygroundInputsContext = createContext<ApiPlaygroundInputsContextType>([\n initialApiPlaygroundInputs,\n () => null,\n]);\n\nApiPlaygroundInputsContext.displayName = 'ApiPlaygroundInputsContext';\n"],"names":["initialApiPlaygroundInputs","ApiPlaygroundInputsContext","createContext"],"mappings":";AAGO,MAAMA,IAAkD;AAAA,EAC7D,QAAQ,CAAA;AAAA,EACR,MAAM,CAAA;AAAA,EACN,OAAO,CAAA;AAAA,EACP,QAAQ,CAAA;AAAA,EACR,QAAQ,CAAA;AAAA,EACR,MAAM;AACR,GA8DaC,IAA6BC,EAA8C;AAAA,EACtFF;AAAA,EACA,MAAM;AACR,CAAC;AAEDC,EAA2B,cAAc;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import { createContext as e } from "react";
|
|
3
|
-
|
|
4
|
-
const t = e({ pageMetadata: {} }), a = e({}), o = e({}), n = e({ apiReferenceData: {} }), C = e({
|
|
3
|
+
const t = e({ pageMetadata: {} }), a = e({}), o = e({}), n = e({ apiReferenceData: {} }), i = e({
|
|
5
4
|
apiReferenceData2: {}
|
|
6
5
|
});
|
|
7
6
|
t.displayName = "PageContext";
|
|
@@ -10,7 +9,7 @@ o.displayName = "DocsConfigContext";
|
|
|
10
9
|
n.displayName = "ApiReferenceContext";
|
|
11
10
|
export {
|
|
12
11
|
n as ApiReferenceContext,
|
|
13
|
-
|
|
12
|
+
i as ApiReferenceContext2,
|
|
14
13
|
a as DeploymentMetadataContext,
|
|
15
14
|
o as DocsConfigContext,
|
|
16
15
|
t as PageContext
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigContext.js","sources":["../../src/contexts/ConfigContext.tsx"],"sourcesContent":["'use client';\n\nimport { MdxExtracts } from '@mintlify/common';\nimport { SerializeSuccess } from '@mintlify/mdx/types';\nimport { InkeepType, MintConfig, PageMetaTags } from '@mintlify/models';\nimport { PageType } from '@mintlify/models';\nimport {\n DeploymentEntitlements,\n GitSource,\n DeploymentFeedbackType,\n DocsConfig,\n DecoratedNavigationConfig,\n TrieveType,\n DeploymentPreviewType,\n} from '@mintlify/validation';\nimport { createContext, ReactNode } from 'react';\n\nimport { addApiReferenceDataFromMdxAndDocsConfig } from '@/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig';\nimport { processSecurityOptions } from '@/api-playground-2/schemaGraph/processSecurityOptions';\nimport type { ApiReferenceDataV2 } from '@/api-playground-2/types';\nimport { ApiReferenceData } from '../utils/api-reference/getApiReferenceData';\n\nexport type PageContextType = {\n pageMetadata: PageMetaTags;\n pageType?: PageType;\n mdxExtracts?: MdxExtracts;\n description?: SerializeSuccess | string | null;\n panelMdxSource?: SerializeSuccess;\n panelMdxSourceWithNoJs?: SerializeSuccess;\n};\n\nexport type DeploymentMetadataContextType = {\n subdomain?: string;\n actualSubdomain?: string;\n gitSource?: GitSource;\n inkeep?: InkeepType;\n trieve?: TrieveType;\n feedback?: DeploymentFeedbackType;\n entitlements?: DeploymentEntitlements;\n buildId?: string;\n clientVersion?: string;\n preview?: DeploymentPreviewType;\n};\n\nexport type DocsConfigContextType = {\n mintConfig?: MintConfig;\n docsConfig?: DocsConfig;\n docsNavWithMetadata?: DecoratedNavigationConfig;\n};\n\nexport type ApiReferenceContextType = {\n apiReferenceData: ApiReferenceData;\n};\n\nexport type ApiReferenceContext2Type = {\n apiReferenceData2: ApiReferenceDataV2;\n};\n\nexport const PageContext = createContext<PageContextType>({ pageMetadata: {} });\n\nexport const DeploymentMetadataContext = createContext<DeploymentMetadataContextType>({});\n\nexport const DocsConfigContext = createContext<DocsConfigContextType>({});\n\nexport const ApiReferenceContext = createContext<ApiReferenceContextType>({ apiReferenceData: {} });\n\nexport const ApiReferenceContext2 = createContext<ApiReferenceContext2Type>({\n apiReferenceData2: {},\n});\n\nPageContext.displayName = 'PageContext';\nDeploymentMetadataContext.displayName = 'DeploymentMetadataContext';\nDocsConfigContext.displayName = 'DocsConfigContext';\nApiReferenceContext.displayName = 'ApiReferenceContext';\n\nexport function PageProvider({ value, children }: { value: PageContextType; children: ReactNode }) {\n return <PageContext.Provider value={value}>{children}</PageContext.Provider>;\n}\n\nexport function DeploymentMetadataProvider({\n value,\n children,\n}: {\n value: DeploymentMetadataContextType;\n children: ReactNode;\n}) {\n return (\n <DeploymentMetadataContext.Provider value={value}>\n {children}\n </DeploymentMetadataContext.Provider>\n );\n}\n\nexport function DocsConfigProvider({\n value,\n children,\n}: {\n value: DocsConfigContextType;\n children: ReactNode;\n}) {\n return <DocsConfigContext.Provider value={value}>{children}</DocsConfigContext.Provider>;\n}\n\nexport function ApiReferenceProvider({\n value,\n children,\n}: {\n value: ApiReferenceContextType;\n children: ReactNode;\n}) {\n return <ApiReferenceContext.Provider value={value}>{children}</ApiReferenceContext.Provider>;\n}\n\nexport function ApiReferenceProvider2({\n pageMetadata,\n docsConfig,\n mdxExtracts,\n apiReferenceData2,\n children,\n}: {\n pageMetadata: PageMetaTags;\n docsConfig: DocsConfig | undefined;\n mdxExtracts: MdxExtracts | undefined;\n apiReferenceData2: ApiReferenceDataV2 | undefined;\n children: ReactNode;\n}) {\n // combine apiReferenceData2 from page props with mdxExtracts and docsConfig so we don't\n // have to go hunting per component for things that can come from other sources\n const apiReferenceDataFromPageProps = apiReferenceData2;\n\n const apiReferenceDataWithMdxAndDocsConfig = addApiReferenceDataFromMdxAndDocsConfig({\n apiReferenceData2: apiReferenceDataFromPageProps,\n mdxExtracts,\n docsConfig,\n pageMetadata,\n });\n\n // after we have the apiReferenceDataWithMdxAndDocsConfig, we can process the security options - some may have come from docs config\n const processedSecurityOptions = processSecurityOptions(apiReferenceDataWithMdxAndDocsConfig);\n if (processedSecurityOptions.length > 0) {\n if (!apiReferenceDataWithMdxAndDocsConfig.dependencies) {\n apiReferenceDataWithMdxAndDocsConfig.dependencies = {\n servers: {},\n security: {},\n processedSecurityOptions: [],\n };\n }\n apiReferenceDataWithMdxAndDocsConfig.dependencies.processedSecurityOptions =\n processedSecurityOptions;\n }\n\n const filteredApiReferenceData = apiReferenceDataWithMdxAndDocsConfig;\n return (\n <ApiReferenceContext2.Provider value={{ apiReferenceData2: filteredApiReferenceData ?? {} }}>\n {children}\n </ApiReferenceContext2.Provider>\n );\n}\n"],"names":["PageContext","createContext","DeploymentMetadataContext","DocsConfigContext","ApiReferenceContext","ApiReferenceContext2"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfigContext.js","sources":["../../src/contexts/ConfigContext.tsx"],"sourcesContent":["'use client';\n\nimport type { MdxExtracts } from '@mintlify/common';\nimport { SerializeSuccess } from '@mintlify/mdx/types';\nimport { InkeepType, MintConfig, PageMetaTags } from '@mintlify/models';\nimport { PageType } from '@mintlify/models';\nimport {\n DeploymentEntitlements,\n GitSource,\n DeploymentFeedbackType,\n DocsConfig,\n DecoratedNavigationConfig,\n TrieveType,\n DeploymentPreviewType,\n} from '@mintlify/validation';\nimport { createContext, ReactNode } from 'react';\n\nimport { addApiReferenceDataFromMdxAndDocsConfig } from '@/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig';\nimport { processSecurityOptions } from '@/api-playground-2/schemaGraph/processSecurityOptions';\nimport type { ApiReferenceDataV2 } from '@/api-playground-2/types';\nimport { ApiReferenceData } from '../utils/api-reference/getApiReferenceData';\n\nexport type PageContextType = {\n pageMetadata: PageMetaTags;\n pageType?: PageType;\n mdxExtracts?: MdxExtracts;\n description?: SerializeSuccess | string | null;\n panelMdxSource?: SerializeSuccess;\n panelMdxSourceWithNoJs?: SerializeSuccess;\n};\n\nexport type DeploymentMetadataContextType = {\n subdomain?: string;\n actualSubdomain?: string;\n gitSource?: GitSource;\n inkeep?: InkeepType;\n trieve?: TrieveType;\n feedback?: DeploymentFeedbackType;\n entitlements?: DeploymentEntitlements;\n buildId?: string;\n clientVersion?: string;\n preview?: DeploymentPreviewType;\n};\n\nexport type DocsConfigContextType = {\n mintConfig?: MintConfig;\n docsConfig?: DocsConfig;\n docsNavWithMetadata?: DecoratedNavigationConfig;\n};\n\nexport type ApiReferenceContextType = {\n apiReferenceData: ApiReferenceData;\n};\n\nexport type ApiReferenceContext2Type = {\n apiReferenceData2: ApiReferenceDataV2;\n};\n\nexport const PageContext = createContext<PageContextType>({ pageMetadata: {} });\n\nexport const DeploymentMetadataContext = createContext<DeploymentMetadataContextType>({});\n\nexport const DocsConfigContext = createContext<DocsConfigContextType>({});\n\nexport const ApiReferenceContext = createContext<ApiReferenceContextType>({ apiReferenceData: {} });\n\nexport const ApiReferenceContext2 = createContext<ApiReferenceContext2Type>({\n apiReferenceData2: {},\n});\n\nPageContext.displayName = 'PageContext';\nDeploymentMetadataContext.displayName = 'DeploymentMetadataContext';\nDocsConfigContext.displayName = 'DocsConfigContext';\nApiReferenceContext.displayName = 'ApiReferenceContext';\n\nexport function PageProvider({ value, children }: { value: PageContextType; children: ReactNode }) {\n return <PageContext.Provider value={value}>{children}</PageContext.Provider>;\n}\n\nexport function DeploymentMetadataProvider({\n value,\n children,\n}: {\n value: DeploymentMetadataContextType;\n children: ReactNode;\n}) {\n return (\n <DeploymentMetadataContext.Provider value={value}>\n {children}\n </DeploymentMetadataContext.Provider>\n );\n}\n\nexport function DocsConfigProvider({\n value,\n children,\n}: {\n value: DocsConfigContextType;\n children: ReactNode;\n}) {\n return <DocsConfigContext.Provider value={value}>{children}</DocsConfigContext.Provider>;\n}\n\nexport function ApiReferenceProvider({\n value,\n children,\n}: {\n value: ApiReferenceContextType;\n children: ReactNode;\n}) {\n return <ApiReferenceContext.Provider value={value}>{children}</ApiReferenceContext.Provider>;\n}\n\nexport function ApiReferenceProvider2({\n pageMetadata,\n docsConfig,\n mdxExtracts,\n apiReferenceData2,\n children,\n}: {\n pageMetadata: PageMetaTags;\n docsConfig: DocsConfig | undefined;\n mdxExtracts: MdxExtracts | undefined;\n apiReferenceData2: ApiReferenceDataV2 | undefined;\n children: ReactNode;\n}) {\n // combine apiReferenceData2 from page props with mdxExtracts and docsConfig so we don't\n // have to go hunting per component for things that can come from other sources\n const apiReferenceDataFromPageProps = apiReferenceData2;\n\n const apiReferenceDataWithMdxAndDocsConfig = addApiReferenceDataFromMdxAndDocsConfig({\n apiReferenceData2: apiReferenceDataFromPageProps,\n mdxExtracts,\n docsConfig,\n pageMetadata,\n });\n\n // after we have the apiReferenceDataWithMdxAndDocsConfig, we can process the security options - some may have come from docs config\n const processedSecurityOptions = processSecurityOptions(apiReferenceDataWithMdxAndDocsConfig);\n if (processedSecurityOptions.length > 0) {\n if (!apiReferenceDataWithMdxAndDocsConfig.dependencies) {\n apiReferenceDataWithMdxAndDocsConfig.dependencies = {\n servers: {},\n security: {},\n processedSecurityOptions: [],\n };\n }\n apiReferenceDataWithMdxAndDocsConfig.dependencies.processedSecurityOptions =\n processedSecurityOptions;\n }\n\n const filteredApiReferenceData = apiReferenceDataWithMdxAndDocsConfig;\n return (\n <ApiReferenceContext2.Provider value={{ apiReferenceData2: filteredApiReferenceData ?? {} }}>\n {children}\n </ApiReferenceContext2.Provider>\n );\n}\n"],"names":["PageContext","createContext","DeploymentMetadataContext","DocsConfigContext","ApiReferenceContext","ApiReferenceContext2"],"mappings":";;AA0DO,MAAMA,IAAcC,EAA+B,EAAE,cAAc,IAAI,GAEjEC,IAA4BD,EAA6C,CAAA,CAAE,GAE3EE,IAAoBF,EAAqC,CAAA,CAAE,GAE3DG,IAAsBH,EAAuC,EAAE,kBAAkB,IAAI,GAErFI,IAAuBJ,EAAwC;AAAA,EAC1E,mBAAmB,CAAA;AACrB,CAAC;AAEDD,EAAY,cAAc;AAC1BE,EAA0B,cAAc;AACxCC,EAAkB,cAAc;AAChCC,EAAoB,cAAc;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as c, createContext as s, useContext as a } from "react";
|
|
3
|
+
import { useCheckHash as p } from "../hooks/useCheckHash.js";
|
|
4
|
+
const o = s({}), u = () => a(o);
|
|
5
|
+
function x({
|
|
6
|
+
location: t,
|
|
7
|
+
children: n
|
|
8
|
+
}) {
|
|
9
|
+
const e = c(!1), r = p();
|
|
10
|
+
return /* @__PURE__ */ i(o.Provider, { value: { location: t, anchor: r, hasScrolledToAnchorRef: e }, children: n });
|
|
11
|
+
}
|
|
12
|
+
o.displayName = "EndpointLocationContext";
|
|
13
|
+
export {
|
|
14
|
+
o as EndpointLocationContext,
|
|
15
|
+
x as EndpointLocationProvider,
|
|
16
|
+
u as useEndpointLocation
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=EndpointLocationContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EndpointLocationContext.js","sources":["../../src/contexts/EndpointLocationContext.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, ReactElement, MutableRefObject, useContext, useRef } from 'react';\n\nimport { useCheckHash } from '../hooks/useCheckHash';\nimport { LocationType } from '../api-playground-2/types/api';\n\nexport type EndpointLocationContextType = {\n location?: LocationType;\n anchor?: string;\n hasScrolledToAnchorRef?: MutableRefObject<boolean>;\n};\n\nexport const EndpointLocationContext = createContext<EndpointLocationContextType>({});\n\nexport const useEndpointLocation = () => useContext(EndpointLocationContext);\n\nexport function EndpointLocationProvider({\n location,\n children,\n}: {\n location?: LocationType;\n children?: ReactElement;\n}) {\n const hasScrolledToAnchorRef = useRef(false);\n const anchor = useCheckHash();\n return (\n <EndpointLocationContext.Provider value={{ location, anchor, hasScrolledToAnchorRef }}>\n {children}\n </EndpointLocationContext.Provider>\n );\n}\n\nEndpointLocationContext.displayName = 'EndpointLocationContext';\n"],"names":["EndpointLocationContext","createContext","useEndpointLocation","useContext","EndpointLocationProvider","location","children","hasScrolledToAnchorRef","useRef","anchor","useCheckHash","jsx"],"mappings":";;;AAaO,MAAMA,IAA0BC,EAA2C,CAAA,CAAE,GAEvEC,IAAsB,MAAMC,EAAWH,CAAuB;AAEpE,SAASI,EAAyB;AAAA,EACvC,UAAAC;AAAA,EACA,UAAAC;AACF,GAGG;AACD,QAAMC,IAAyBC,EAAO,EAAK,GACrCC,IAASC,EAAA;AACf,SACE,gBAAAC,EAACX,EAAwB,UAAxB,EAAiC,OAAO,EAAE,UAAAK,GAAU,QAAAI,GAAQ,wBAAAF,KAC1D,UAAAD,GACH;AAEJ;AAEAN,EAAwB,cAAc;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import { createContext as e } from "react";
|
|
3
|
+
import "./ConfigContext.js";
|
|
4
|
+
const t = {
|
|
5
|
+
headings: [],
|
|
6
|
+
apiBaseIndex: 0,
|
|
7
|
+
codeExamples: {},
|
|
8
|
+
pageMetadata: {},
|
|
9
|
+
selectedBodyContentType: void 0,
|
|
10
|
+
selectedResponseContentType: void 0,
|
|
11
|
+
tableOfContents: [],
|
|
12
|
+
changelogFilters: []
|
|
13
|
+
}, n = e([t, () => null]);
|
|
14
|
+
n.displayName = "MDXContentContext";
|
|
15
|
+
export {
|
|
16
|
+
n as MDXContentContext,
|
|
17
|
+
t as initialState
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=MDXContentContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MDXContentContext.js","sources":["../../src/contexts/MDXContentContext.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, ReactNode, Reducer, useContext, useMemo, useReducer } from 'react';\n\nimport { ChangelogFilterType, HeadingType, MDXContentState } from '../types/mdxContentController';\n\nimport { PageContext } from './ConfigContext';\n\nexport const initialState: MDXContentState = {\n headings: [],\n apiBaseIndex: 0,\n codeExamples: {},\n pageMetadata: {},\n selectedBodyContentType: undefined,\n selectedResponseContentType: undefined,\n tableOfContents: [],\n changelogFilters: [],\n};\n\n/**\n * Actions that can be dispatched in the MDXContentReducer.\n */\ntype MDXContentAction =\n | { type: 'set_state'; payload: Partial<MDXContentState> }\n | { type: 'set_api_base_index'; payload: number }\n | { type: 'set_selected_body_content_type'; payload: string }\n | { type: 'set_selected_response_content_type'; payload: string }\n | { type: 'register_heading'; payload: HeadingType }\n | { type: 'unregister_heading'; payload: string }\n | { type: 'toggle_changelog_filter'; payload: ChangelogFilterType };\n\nexport type MDXContentActionType = MDXContentAction['type'];\n\n/**\n * Consolidates state and update logic of MDXContentController.\n * @param state - current state.\n * @param action - state action to dispatch.\n * @returns MDXContentState - new state.\n */\nexport const MDXContentReducer: Reducer<MDXContentState, MDXContentAction> = (\n state: MDXContentState,\n action\n) => {\n const type = action.type;\n switch (type) {\n case 'set_state':\n return {\n ...state,\n ...action.payload,\n };\n case 'register_heading':\n const { id, top } = action.payload;\n return {\n ...state,\n headings: [...state.headings.filter((h) => id !== h.id), { id, top }],\n };\n case 'unregister_heading':\n return {\n ...state,\n headings: state.headings.filter((h) => action.payload !== h.id),\n };\n case 'set_selected_body_content_type':\n return {\n ...state,\n selectedBodyContentType: action.payload,\n };\n case 'set_selected_response_content_type':\n return {\n ...state,\n selectedResponseContentType: action.payload,\n };\n case 'set_api_base_index':\n return {\n ...state,\n apiBaseIndex: action.payload,\n };\n case 'toggle_changelog_filter':\n const existingFilterIndex = state.changelogFilters.findIndex(\n (filter) => filter.tag === action.payload.tag\n );\n if (existingFilterIndex !== -1) {\n const newFilters = [...state.changelogFilters];\n newFilters[existingFilterIndex] = action.payload;\n return {\n ...state,\n changelogFilters: newFilters,\n };\n }\n return {\n ...state,\n changelogFilters: [...state.changelogFilters, action.payload],\n };\n }\n};\n\nexport const useMDXContentReducer = (state?: Partial<MDXContentState>) => {\n const initializedState = {\n ...initialState,\n ...state,\n };\n return useReducer(MDXContentReducer, initializedState);\n};\n\nexport function useInitializeMDXContentReducer() {\n const { pageMetadata, mdxExtracts } = useContext(PageContext);\n const initialSelectedBodyContentType = Object.keys(mdxExtracts?.endpoint?.request.body ?? {})[0];\n\n const ctx = useMDXContentReducer({\n pageMetadata,\n selectedBodyContentType: initialSelectedBodyContentType,\n ...mdxExtracts,\n });\n\n return useMemo(() => {\n return ctx;\n }, [ctx]);\n}\n\nexport type MDXContentContextType = ReturnType<typeof useMDXContentReducer>;\n\nexport const MDXContentContext = createContext<MDXContentContextType>([initialState, () => null]);\n\nexport function MDXContentProvider({ children }: { children: ReactNode }) {\n const ctx = useInitializeMDXContentReducer();\n return <MDXContentContext.Provider value={ctx}>{children}</MDXContentContext.Provider>;\n}\n\nMDXContentContext.displayName = 'MDXContentContext';\n"],"names":["initialState","MDXContentContext","createContext"],"mappings":";;;AAQO,MAAMA,IAAgC;AAAA,EAC3C,UAAU,CAAA;AAAA,EACV,cAAc;AAAA,EACd,cAAc,CAAA;AAAA,EACd,cAAc,CAAA;AAAA,EACd,yBAAyB;AAAA,EACzB,6BAA6B;AAAA,EAC7B,iBAAiB,CAAA;AAAA,EACjB,kBAAkB,CAAA;AACpB,GAuGaC,IAAoBC,EAAqC,CAACF,GAAc,MAAM,IAAI,CAAC;AAOhGC,EAAkB,cAAc;"}
|
package/dist/env.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
var e;
|
|
2
|
-
|
|
2
|
+
const _ = {
|
|
3
|
+
BASE_PATH: typeof process < "u" && ((e = process.env) != null && e.NEXT_PUBLIC_BASE_PATH) ? process.env.NEXT_PUBLIC_BASE_PATH : ""
|
|
4
|
+
};
|
|
5
|
+
export {
|
|
6
|
+
_ as NEXT_PUBLIC
|
|
7
|
+
};
|
|
3
8
|
//# sourceMappingURL=env.js.map
|
package/dist/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sources":["../src/env.ts"],"sourcesContent":["export const NEXT_PUBLIC = {\n BASE_PATH: typeof process !== 'undefined' && process.env?.NEXT_PUBLIC_BASE_PATH\n ? process.env.NEXT_PUBLIC_BASE_PATH\n : '',\n};\n"],"names":["_a"],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.js","sources":["../src/env.ts"],"sourcesContent":["export const NEXT_PUBLIC = {\n BASE_PATH: typeof process !== 'undefined' && process.env?.NEXT_PUBLIC_BASE_PATH\n ? process.env.NEXT_PUBLIC_BASE_PATH\n : '',\n};\n"],"names":["_a","NEXT_PUBLIC"],"mappings":"AAAO,IAAAA;AAAA,MAAMC,IAAc;AAAA,EACzB,WAAW,OAAO,UAAY,SAAeD,IAAA,QAAQ,QAAR,QAAAA,EAAa,yBACtD,QAAQ,IAAI,wBACZ;AACN;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApiPlaygroundInputs.js","sources":["../../src/hooks/useApiPlaygroundInputs.ts"],"sourcesContent":["'use client';\n\nimport { useContext } from 'react';\n\nimport { ApiPlaygroundInputsContext } from '@/contexts/ApiPlaygroundInputsContext';\n\nexport const useApiPlaygroundInputs = () => useContext(ApiPlaygroundInputsContext);\n"],"names":["useApiPlaygroundInputs","useContext","ApiPlaygroundInputsContext"],"mappings":";;AAMO,MAAMA,IAAyB,MAAMC,EAAWC,CAA0B;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useContext as m } from "react";
|
|
2
|
+
import { initialApiPlaygroundInputs as s } from "../contexts/ApiPlaygroundInputsContext.js";
|
|
3
|
+
import { DocsConfigContext as u } from "../contexts/ConfigContext.js";
|
|
4
|
+
import { useMDXContent as c } from "./useMDXContent.js";
|
|
5
|
+
import { useBaseUrlOptions as f } from "./useBaseUrlOptions.js";
|
|
6
|
+
import { useEndpoint as x } from "./useEndpoint.js";
|
|
7
|
+
const D = () => {
|
|
8
|
+
var r, i;
|
|
9
|
+
const { docsConfig: t } = m(u), n = x(), e = f(), [{ apiBaseIndex: o }] = c(), a = (e == null ? void 0 : e[o]) ?? (e == null ? void 0 : e[0]), l = n !== void 0 && a !== void 0;
|
|
10
|
+
return !((i = (r = t == null ? void 0 : t.api) == null ? void 0 : r.examples) != null && i.prefill) || !l ? {
|
|
11
|
+
prefillExamplesEnabled: !1,
|
|
12
|
+
generatedRequestExampleData: [s]
|
|
13
|
+
} : { prefillExamplesEnabled: !0, generatedRequestExampleData: d(n) };
|
|
14
|
+
}, d = (t) => {
|
|
15
|
+
const [n] = Object.entries(t.request.body);
|
|
16
|
+
if (n === void 0)
|
|
17
|
+
return [s];
|
|
18
|
+
const [e, o] = n, a = Object.values(o.examples)[0];
|
|
19
|
+
if (a === void 0)
|
|
20
|
+
return [s];
|
|
21
|
+
if (Object.keys(o.examples).length > 1) {
|
|
22
|
+
const l = Object.values(o.examples), p = [];
|
|
23
|
+
for (const r of l)
|
|
24
|
+
p.push({
|
|
25
|
+
...s,
|
|
26
|
+
body: r.value
|
|
27
|
+
});
|
|
28
|
+
return p;
|
|
29
|
+
} else
|
|
30
|
+
return [
|
|
31
|
+
{
|
|
32
|
+
...s,
|
|
33
|
+
body: a.value
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
D as useApiPlaygroundPrefillExamples
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=useApiPlaygroundPrefillExamples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApiPlaygroundPrefillExamples.js","sources":["../../src/hooks/useApiPlaygroundPrefillExamples.ts"],"sourcesContent":["import { ApiPlaygroundInputs, Endpoint } from '@mintlify/validation';\nimport { useContext } from 'react';\n\nimport { initialApiPlaygroundInputs } from '@/contexts/ApiPlaygroundInputsContext';\nimport { DocsConfigContext } from '@/contexts/ConfigContext';\nimport { useMDXContent } from '@/hooks/useMDXContent';\n\nimport { useBaseUrlOptions } from './useBaseUrlOptions';\nimport { useEndpoint } from './useEndpoint';\n\nexport const useApiPlaygroundPrefillExamples = (): {\n prefillExamplesEnabled: boolean;\n generatedRequestExampleData: ApiPlaygroundInputs[];\n} => {\n const { docsConfig } = useContext(DocsConfigContext);\n const endpoint = useEndpoint();\n const baseUrlOptions = useBaseUrlOptions();\n const [{ apiBaseIndex }] = useMDXContent();\n const baseUrl = baseUrlOptions?.[apiBaseIndex] ?? baseUrlOptions?.[0];\n const canGenerateRequestExamples = endpoint !== undefined && baseUrl !== undefined;\n\n if (!docsConfig?.api?.examples?.prefill || !canGenerateRequestExamples)\n return {\n prefillExamplesEnabled: false,\n generatedRequestExampleData: [initialApiPlaygroundInputs],\n };\n\n const generatedRequestExampleData = generatePrefillRequestData(endpoint);\n\n return { prefillExamplesEnabled: true, generatedRequestExampleData };\n};\n\nconst generatePrefillRequestData = (endpoint: Endpoint): ApiPlaygroundInputs[] => {\n const [contentTypeAndContent] = Object.entries(endpoint.request.body);\n if (contentTypeAndContent === undefined) {\n return [initialApiPlaygroundInputs];\n }\n const [_, content] = contentTypeAndContent;\n const firstExample = Object.values(content.examples)[0];\n if (firstExample === undefined) {\n return [initialApiPlaygroundInputs];\n }\n\n if (Object.keys(content.examples).length > 1) {\n const exampleValues = Object.values(content.examples);\n const examples = [];\n for (const example of exampleValues) {\n examples.push({\n ...initialApiPlaygroundInputs,\n body: example.value,\n });\n }\n return examples;\n } else {\n return [\n {\n ...initialApiPlaygroundInputs,\n body: firstExample.value,\n },\n ];\n }\n};\n"],"names":["useApiPlaygroundPrefillExamples","docsConfig","useContext","DocsConfigContext","endpoint","useEndpoint","baseUrlOptions","useBaseUrlOptions","apiBaseIndex","useMDXContent","baseUrl","canGenerateRequestExamples","_b","_a","initialApiPlaygroundInputs","generatePrefillRequestData","contentTypeAndContent","_","content","firstExample","exampleValues","examples","example"],"mappings":";;;;;;AAUO,MAAMA,IAAkC,MAG1C;;AACH,QAAM,EAAE,YAAAC,EAAA,IAAeC,EAAWC,CAAiB,GAC7CC,IAAWC,EAAA,GACXC,IAAiBC,EAAA,GACjB,CAAC,EAAE,cAAAC,GAAc,IAAIC,EAAA,GACrBC,KAAUJ,KAAA,gBAAAA,EAAiBE,QAAiBF,KAAA,gBAAAA,EAAiB,KAC7DK,IAA6BP,MAAa,UAAaM,MAAY;AAEzE,SAAI,GAACE,KAAAC,IAAAZ,KAAA,gBAAAA,EAAY,QAAZ,gBAAAY,EAAiB,aAAjB,QAAAD,EAA2B,YAAW,CAACD,IACnC;AAAA,IACL,wBAAwB;AAAA,IACxB,6BAA6B,CAACG,CAA0B;AAAA,EAAA,IAKrD,EAAE,wBAAwB,IAAM,6BAFHC,EAA2BX,CAAQ,EAEhC;AACzC,GAEMW,IAA6B,CAACX,MAA8C;AAChF,QAAM,CAACY,CAAqB,IAAI,OAAO,QAAQZ,EAAS,QAAQ,IAAI;AACpE,MAAIY,MAA0B;AAC5B,WAAO,CAACF,CAA0B;AAEpC,QAAM,CAACG,GAAGC,CAAO,IAAIF,GACfG,IAAe,OAAO,OAAOD,EAAQ,QAAQ,EAAE,CAAC;AACtD,MAAIC,MAAiB;AACnB,WAAO,CAACL,CAA0B;AAGpC,MAAI,OAAO,KAAKI,EAAQ,QAAQ,EAAE,SAAS,GAAG;AAC5C,UAAME,IAAgB,OAAO,OAAOF,EAAQ,QAAQ,GAC9CG,IAAW,CAAA;AACjB,eAAWC,KAAWF;AACpB,MAAAC,EAAS,KAAK;AAAA,QACZ,GAAGP;AAAA,QACH,MAAMQ,EAAQ;AAAA,MAAA,CACf;AAEH,WAAOD;AAAA,EACT;AACE,WAAO;AAAA,MACL;AAAA,QACE,GAAGP;AAAA,QACH,MAAMK,EAAa;AAAA,MAAA;AAAA,IACrB;AAGN;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useContext as l, useMemo as x } from "react";
|
|
2
|
+
import { DocsConfigContext as a } from "../contexts/ConfigContext.js";
|
|
3
|
+
import { useEndpoint as c } from "./useEndpoint.js";
|
|
4
|
+
const O = () => {
|
|
5
|
+
var o, m;
|
|
6
|
+
const r = c(), { docsConfig: e } = l(a);
|
|
7
|
+
return x(() => {
|
|
8
|
+
var n, p, u;
|
|
9
|
+
const t = (n = r == null ? void 0 : r.servers) == null ? void 0 : n.map(({ url: i }) => i);
|
|
10
|
+
if (t && t.length > 0)
|
|
11
|
+
return t;
|
|
12
|
+
const s = (u = (p = e == null ? void 0 : e.api) == null ? void 0 : p.mdx) == null ? void 0 : u.server;
|
|
13
|
+
return typeof s == "string" ? [s] : s;
|
|
14
|
+
}, [r == null ? void 0 : r.servers, (m = (o = e == null ? void 0 : e.api) == null ? void 0 : o.mdx) == null ? void 0 : m.server]);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
O as useBaseUrlOptions
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useBaseUrlOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBaseUrlOptions.js","sources":["../../src/hooks/useBaseUrlOptions.ts"],"sourcesContent":["'use client';\n\nimport { useContext, useMemo } from 'react';\n\nimport { DocsConfigContext } from '../contexts/ConfigContext';\n\nimport { useEndpoint } from '../hooks/useEndpoint';\n\nexport const useBaseUrlOptions = () => {\n const endpoint = useEndpoint();\n const { docsConfig } = useContext(DocsConfigContext);\n\n return useMemo(() => {\n const endpointUrls = endpoint?.servers?.map(({ url }) => url);\n if (endpointUrls && endpointUrls.length > 0) {\n return endpointUrls;\n }\n\n const configUrlOrUrls = docsConfig?.api?.mdx?.server;\n return typeof configUrlOrUrls === 'string' ? [configUrlOrUrls] : configUrlOrUrls;\n }, [endpoint?.servers, docsConfig?.api?.mdx?.server]);\n};\n"],"names":["useBaseUrlOptions","endpoint","useEndpoint","docsConfig","useContext","DocsConfigContext","useMemo","endpointUrls","_a","url","configUrlOrUrls","_c","_b"],"mappings":";;;AAQO,MAAMA,IAAoB,MAAM;;AACrC,QAAMC,IAAWC,EAAA,GACX,EAAE,YAAAC,EAAA,IAAeC,EAAWC,CAAiB;AAEnD,SAAOC,EAAQ,MAAM;;AACnB,UAAMC,KAAeC,IAAAP,KAAA,gBAAAA,EAAU,YAAV,gBAAAO,EAAmB,IAAI,CAAC,EAAE,KAAAC,EAAA,MAAUA;AACzD,QAAIF,KAAgBA,EAAa,SAAS;AACxC,aAAOA;AAGT,UAAMG,KAAkBC,KAAAC,IAAAT,KAAA,gBAAAA,EAAY,QAAZ,gBAAAS,EAAiB,QAAjB,gBAAAD,EAAsB;AAC9C,WAAO,OAAOD,KAAoB,WAAW,CAACA,CAAe,IAAIA;AAAA,EACnE,GAAG,CAACT,KAAA,gBAAAA,EAAU,UAASW,KAAAJ,IAAAL,KAAA,gBAAAA,EAAY,QAAZ,gBAAAK,EAAiB,QAAjB,gBAAAI,EAAsB,MAAM,CAAC;AACtD;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useState as r, useEffect as h } from "react";
|
|
2
|
+
const c = () => {
|
|
3
|
+
const [o, t] = r(void 0);
|
|
4
|
+
return h(() => {
|
|
5
|
+
const e = () => {
|
|
6
|
+
if (typeof window > "u") return;
|
|
7
|
+
const n = window.location.hash;
|
|
8
|
+
n && t(n);
|
|
9
|
+
};
|
|
10
|
+
return e(), window.addEventListener("hashchange", e), () => {
|
|
11
|
+
window.removeEventListener("hashchange", e);
|
|
12
|
+
};
|
|
13
|
+
}, []), o;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
c as useCheckHash
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useCheckHash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCheckHash.js","sources":["../../src/hooks/useCheckHash.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport const useCheckHash = () => {\n const [anchor, setAnchor] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n const checkHashToExpand = () => {\n if (typeof window === 'undefined') return;\n const anchor = window.location.hash;\n if (!anchor) return;\n setAnchor(anchor);\n };\n\n checkHashToExpand();\n window.addEventListener('hashchange', checkHashToExpand);\n return () => {\n window.removeEventListener('hashchange', checkHashToExpand);\n };\n }, []);\n\n return anchor;\n};\n"],"names":["useCheckHash","anchor","setAnchor","useState","useEffect","checkHashToExpand"],"mappings":";AAEO,MAAMA,IAAe,MAAM;AAChC,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAA6B,MAAS;AAElE,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAoB,MAAM;AAC9B,UAAI,OAAO,SAAW,IAAa;AACnC,YAAMJ,IAAS,OAAO,SAAS;AAC/B,MAAKA,KACLC,EAAUD,CAAM;AAAA,IAClB;AAEA,WAAAI,EAAA,GACA,OAAO,iBAAiB,cAAcA,CAAiB,GAChD,MAAM;AACX,aAAO,oBAAoB,cAAcA,CAAiB;AAAA,IAC5D;AAAA,EACF,GAAG,CAAA,CAAE,GAEEJ;AACT;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext as o } from "react";
|
|
2
|
+
import { ApiReferenceContext as t } from "../contexts/ConfigContext.js";
|
|
3
|
+
const m = () => {
|
|
4
|
+
const { apiReferenceData: e } = o(t);
|
|
5
|
+
return e.componentSchemas;
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
m as useComponentSchemas
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useComponentSchemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useComponentSchemas.js","sources":["../../src/hooks/useComponentSchemas.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { ApiReferenceContext } from '@/contexts/ConfigContext';\n\nexport const useComponentSchemas = () => {\n const { apiReferenceData } = useContext(ApiReferenceContext);\n return apiReferenceData.componentSchemas;\n};\n"],"names":["useComponentSchemas","apiReferenceData","useContext","ApiReferenceContext"],"mappings":";;AAIO,MAAMA,IAAsB,MAAM;AACvC,QAAM,EAAE,kBAAAC,EAAA,IAAqBC,EAAWC,CAAmB;AAC3D,SAAOF,EAAiB;AAC1B;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useParams as n } from "next/navigation";
|
|
2
|
+
import { useMemo as m } from "react";
|
|
3
|
+
import { decodeSlug as s } from "../utils/decodeSlug.js";
|
|
4
|
+
import { optionallyAddLeadingSlash as u } from "../utils/optionallyAddLeadingSlash.js";
|
|
5
|
+
function f() {
|
|
6
|
+
var r;
|
|
7
|
+
const o = (r = n()) == null ? void 0 : r.slug;
|
|
8
|
+
return m(() => {
|
|
9
|
+
var t;
|
|
10
|
+
const e = typeof o == "string" ? decodeURIComponent(o) : (t = s(o)) == null ? void 0 : t.join("/");
|
|
11
|
+
return u(e ?? "");
|
|
12
|
+
}, [o]);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
f as useCurrentPath
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useCurrentPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCurrentPath.js","sources":["../../src/hooks/useCurrentPath.ts"],"sourcesContent":["'use client';\n\nimport { useParams } from 'next/navigation';\nimport { useMemo } from 'react';\n\nimport { decodeSlug } from '../utils/decodeSlug';\nimport { optionallyAddLeadingSlash } from '../utils/optionallyAddLeadingSlash';\n\n/**\n * @returns Path with a leading slash, no base path\n */\nexport function useCurrentPath() {\n const slug = useParams()?.slug;\n return useMemo(() => {\n const pathname =\n typeof slug === 'string' ? decodeURIComponent(slug) : decodeSlug(slug)?.join('/');\n return optionallyAddLeadingSlash(pathname ?? '');\n }, [slug]);\n}\n"],"names":["useCurrentPath","slug","_a","useParams","useMemo","pathname","decodeSlug","optionallyAddLeadingSlash"],"mappings":";;;;AAWO,SAASA,IAAiB;;AAC/B,QAAMC,KAAOC,IAAAC,QAAA,gBAAAD,EAAa;AAC1B,SAAOE,EAAQ,MAAM;;AACnB,UAAMC,IACJ,OAAOJ,KAAS,WAAW,mBAAmBA,CAAI,KAAIC,IAAAI,EAAWL,CAAI,MAAf,gBAAAC,EAAkB,KAAK;AAC/E,WAAOK,EAA0BF,KAAY,EAAE;AAAA,EACjD,GAAG,CAACJ,CAAI,CAAC;AACX;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useContext as n, useMemo as t } from "react";
|
|
2
2
|
import { ApiReferenceContext as o } from "../contexts/ConfigContext.js";
|
|
3
3
|
const p = () => {
|
|
4
4
|
const {
|
|
5
5
|
apiReferenceData: { endpoint: e }
|
|
6
|
-
} =
|
|
6
|
+
} = n(o);
|
|
7
7
|
return e;
|
|
8
8
|
}, s = () => {
|
|
9
9
|
const e = p();
|
|
10
|
-
return
|
|
10
|
+
return t(() => e, [e]);
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
13
|
s as useEndpoint,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useRef as m, useState as g, useEffect as f, useCallback as p } from "react";
|
|
2
|
+
const i = "user_toggled_expandables", b = () => {
|
|
3
|
+
try {
|
|
4
|
+
const e = sessionStorage.getItem(i);
|
|
5
|
+
return e ? JSON.parse(e) : {};
|
|
6
|
+
} catch {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
}, S = (e, n) => {
|
|
10
|
+
try {
|
|
11
|
+
const s = { ...b(), [e]: n };
|
|
12
|
+
sessionStorage.setItem(i, JSON.stringify(s));
|
|
13
|
+
} catch {
|
|
14
|
+
}
|
|
15
|
+
}, x = (e, n = !1) => {
|
|
16
|
+
const a = m(null), [s, l] = g(!1), [y, o] = g(n);
|
|
17
|
+
f(() => {
|
|
18
|
+
if (!e) return;
|
|
19
|
+
const t = b();
|
|
20
|
+
e in t && (o(!!t[e]), l(!0));
|
|
21
|
+
}, [e]), f(() => {
|
|
22
|
+
const t = new IntersectionObserver(
|
|
23
|
+
(c) => {
|
|
24
|
+
c[0] && c[0].isIntersecting && !s && n && o((u) => u || !0);
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
rootMargin: "100px",
|
|
28
|
+
threshold: 0
|
|
29
|
+
}
|
|
30
|
+
), r = a.current;
|
|
31
|
+
return r && t.observe(r), () => {
|
|
32
|
+
r && t.unobserve(r);
|
|
33
|
+
};
|
|
34
|
+
}, [s, n]);
|
|
35
|
+
const E = p(
|
|
36
|
+
(t) => {
|
|
37
|
+
o(t), l(!0), e && S(e, t);
|
|
38
|
+
},
|
|
39
|
+
[e]
|
|
40
|
+
);
|
|
41
|
+
return { ref: a, isExpanded: y, onManualToggle: E };
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
x as useExpandableMemory
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=useExpandableMemory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useExpandableMemory.js","sources":["../../src/hooks/useExpandableMemory.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nconst USER_TOGGLED_EXPANDABLES_KEY = 'user_toggled_expandables';\n\nconst getManuallyToggledExpandables = (): Record<string, boolean> => {\n try {\n const manuallyToggledExpandables = sessionStorage.getItem(USER_TOGGLED_EXPANDABLES_KEY);\n return manuallyToggledExpandables ? JSON.parse(manuallyToggledExpandables) : {};\n } catch {\n return {};\n }\n};\n\nconst saveManuallyToggledState = (id: string, isExpanded: boolean) => {\n try {\n const current = getManuallyToggledExpandables();\n const updated = { ...current, [id]: isExpanded };\n sessionStorage.setItem(USER_TOGGLED_EXPANDABLES_KEY, JSON.stringify(updated));\n } catch {\n // silently fail if setItem() fails\n }\n};\n\nexport const useExpandableMemory = (id: string | undefined, defaultExpanded = false) => {\n const ref = useRef<HTMLDivElement>(null);\n\n // track if user manually clicked the expandable\n const [manuallyChanged, setManuallyChanged] = useState(false);\n\n const [isExpanded, setIsExpanded] = useState(defaultExpanded);\n\n useEffect(() => {\n if (!id) return;\n\n const manuallyToggledExpandables = getManuallyToggledExpandables();\n if (id in manuallyToggledExpandables) {\n setIsExpanded(!!manuallyToggledExpandables[id]);\n setManuallyChanged(true);\n }\n }, [id]);\n\n useEffect(() => {\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0]) {\n // Only auto-expand if the user hasn't manually clicked the expandable\n // Don't update visibility state constantly during scroll\n if (entries[0].isIntersecting && !manuallyChanged && defaultExpanded) {\n setIsExpanded((prev) => (!prev ? true : prev));\n }\n }\n },\n {\n rootMargin: '100px',\n threshold: 0,\n }\n );\n\n const currentRef = ref.current;\n if (currentRef) {\n observer.observe(currentRef);\n }\n\n return () => {\n if (currentRef) {\n observer.unobserve(currentRef);\n }\n };\n }, [manuallyChanged, defaultExpanded]);\n\n const onManualToggle = useCallback(\n (expanded: boolean) => {\n setIsExpanded(expanded);\n setManuallyChanged(true);\n\n if (id) {\n saveManuallyToggledState(id, expanded);\n }\n },\n [id]\n );\n\n return { ref, isExpanded, onManualToggle };\n};\n"],"names":["USER_TOGGLED_EXPANDABLES_KEY","getManuallyToggledExpandables","manuallyToggledExpandables","saveManuallyToggledState","id","isExpanded","updated","useExpandableMemory","defaultExpanded","ref","useRef","manuallyChanged","setManuallyChanged","useState","setIsExpanded","useEffect","observer","entries","prev","currentRef","onManualToggle","useCallback","expanded"],"mappings":";AAEA,MAAMA,IAA+B,4BAE/BC,IAAgC,MAA+B;AACnE,MAAI;AACF,UAAMC,IAA6B,eAAe,QAAQF,CAA4B;AACtF,WAAOE,IAA6B,KAAK,MAAMA,CAA0B,IAAI,CAAA;AAAA,EAC/E,QAAS;AACP,WAAO,CAAA;AAAA,EACT;AACF,GAEMC,IAA2B,CAACC,GAAYC,MAAwB;AACpE,MAAI;AAEF,UAAMC,IAAU,EAAE,GADFL,EAAA,GACc,CAACG,CAAE,GAAGC,EAAA;AACpC,mBAAe,QAAQL,GAA8B,KAAK,UAAUM,CAAO,CAAC;AAAA,EAC9E,QAAQ;AAAA,EAER;AACF,GAEaC,IAAsB,CAACH,GAAwBI,IAAkB,OAAU;AACtF,QAAMC,IAAMC,EAAuB,IAAI,GAGjC,CAACC,GAAiBC,CAAkB,IAAIC,EAAS,EAAK,GAEtD,CAACR,GAAYS,CAAa,IAAID,EAASL,CAAe;AAE5D,EAAAO,EAAU,MAAM;AACd,QAAI,CAACX,EAAI;AAET,UAAMF,IAA6BD,EAAA;AACnC,IAAIG,KAAMF,MACRY,EAAc,CAAC,CAACZ,EAA2BE,CAAE,CAAC,GAC9CQ,EAAmB,EAAI;AAAA,EAE3B,GAAG,CAACR,CAAE,CAAC,GAEPW,EAAU,MAAM;AACd,UAAMC,IAAW,IAAI;AAAA,MACnB,CAACC,MAAY;AACX,QAAIA,EAAQ,CAAC,KAGPA,EAAQ,CAAC,EAAE,kBAAkB,CAACN,KAAmBH,KACnDM,EAAc,CAACI,MAAWA,KAAO,EAAY;AAAA,MAGnD;AAAA,MACA;AAAA,QACE,YAAY;AAAA,QACZ,WAAW;AAAA,MAAA;AAAA,IACb,GAGIC,IAAaV,EAAI;AACvB,WAAIU,KACFH,EAAS,QAAQG,CAAU,GAGtB,MAAM;AACX,MAAIA,KACFH,EAAS,UAAUG,CAAU;AAAA,IAEjC;AAAA,EACF,GAAG,CAACR,GAAiBH,CAAe,CAAC;AAErC,QAAMY,IAAiBC;AAAA,IACrB,CAACC,MAAsB;AACrB,MAAAR,EAAcQ,CAAQ,GACtBV,EAAmB,EAAI,GAEnBR,KACFD,EAAyBC,GAAIkB,CAAQ;AAAA,IAEzC;AAAA,IACA,CAAClB,CAAE;AAAA,EAAA;AAGL,SAAO,EAAE,KAAAK,GAAK,YAAAJ,GAAY,gBAAAe,EAAA;AAC5B;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useMemo as r } from "react";
|
|
2
|
+
import { useEndpointLocation as n } from "../contexts/EndpointLocationContext.js";
|
|
3
|
+
import { generateNextAdditionalProperties as i } from "../openapi/generateNextAdditionalProperties.js";
|
|
4
|
+
import { useComponentSchemas as m } from "./useComponentSchemas.js";
|
|
5
|
+
function u(o) {
|
|
6
|
+
const e = m(), { location: t } = n();
|
|
7
|
+
return r(() => i(o, e, t), [o, e, t]);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
u as useGenerateNextAdditionalProperties
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useGenerateNextAdditionalProperties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGenerateNextAdditionalProperties.js","sources":["../../src/hooks/useGenerateNextAdditionalProperties.ts"],"sourcesContent":["import { IncrementalObjectSchema, ObjectSchema } from '@mintlify/validation';\nimport { useMemo } from 'react';\n\nimport { useEndpointLocation } from '@/contexts/EndpointLocationContext';\nimport { generateNextAdditionalProperties } from '@/openapi/generateNextAdditionalProperties';\n\nimport { useComponentSchemas } from './useComponentSchemas';\n\nexport function useGenerateNextAdditionalProperties(\n schema: ObjectSchema | IncrementalObjectSchema\n) {\n const componentSchemas = useComponentSchemas();\n const { location } = useEndpointLocation();\n\n return useMemo(() => {\n return generateNextAdditionalProperties(schema, componentSchemas, location);\n }, [schema, componentSchemas, location]);\n}\n"],"names":["useGenerateNextAdditionalProperties","schema","componentSchemas","useComponentSchemas","location","useEndpointLocation","useMemo","generateNextAdditionalProperties"],"mappings":";;;;AAQO,SAASA,EACdC,GACA;AACA,QAAMC,IAAmBC,EAAA,GACnB,EAAE,UAAAC,EAAA,IAAaC,EAAA;AAErB,SAAOC,EAAQ,MACNC,EAAiCN,GAAQC,GAAkBE,CAAQ,GACzE,CAACH,GAAQC,GAAkBE,CAAQ,CAAC;AACzC;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useMemo as n } from "react";
|
|
2
|
+
import { useEndpointLocation as r } from "../contexts/EndpointLocationContext.js";
|
|
3
|
+
import { generateNextItems as m } from "../openapi/generateNextItems.js";
|
|
4
|
+
import { useComponentSchemas as s } from "./useComponentSchemas.js";
|
|
5
|
+
function a(o) {
|
|
6
|
+
const e = s(), { location: t } = r();
|
|
7
|
+
return n(() => m(o, e, t), [o, e, t]);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
a as useGenerateNextItems
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useGenerateNextItems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGenerateNextItems.js","sources":["../../src/hooks/useGenerateNextItems.ts"],"sourcesContent":["import { ArraySchema, IncrementalArraySchema } from '@mintlify/validation';\nimport { useMemo } from 'react';\n\nimport { useEndpointLocation } from '@/contexts/EndpointLocationContext';\nimport { generateNextItems } from '@/openapi/generateNextItems';\n\nimport { useComponentSchemas } from './useComponentSchemas';\n\nexport function useGenerateNextItems(schema: ArraySchema | IncrementalArraySchema) {\n const componentSchemas = useComponentSchemas();\n const { location } = useEndpointLocation();\n\n return useMemo(() => {\n return generateNextItems(schema, componentSchemas, location);\n }, [schema, componentSchemas, location]);\n}\n"],"names":["useGenerateNextItems","schema","componentSchemas","useComponentSchemas","location","useEndpointLocation","useMemo","generateNextItems"],"mappings":";;;;AAQO,SAASA,EAAqBC,GAA8C;AACjF,QAAMC,IAAmBC,EAAA,GACnB,EAAE,UAAAC,EAAA,IAAaC,EAAA;AAErB,SAAOC,EAAQ,MACNC,EAAkBN,GAAQC,GAAkBE,CAAQ,GAC1D,CAACH,GAAQC,GAAkBE,CAAQ,CAAC;AACzC;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useMemo as r } from "react";
|
|
2
|
+
import { useEndpointLocation as n } from "../contexts/EndpointLocationContext.js";
|
|
3
|
+
import { generateNextProperties as m } from "../openapi/generateNextProperties.js";
|
|
4
|
+
import { useComponentSchemas as i } from "./useComponentSchemas.js";
|
|
5
|
+
function a(o) {
|
|
6
|
+
const e = i(), { location: t } = n();
|
|
7
|
+
return r(() => m(o, e, t), [o, e, t]);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
a as useGenerateNextProperties
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useGenerateNextProperties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGenerateNextProperties.js","sources":["../../src/hooks/useGenerateNextProperties.ts"],"sourcesContent":["import { IncrementalObjectSchema, ObjectSchema } from '@mintlify/validation';\nimport { useMemo } from 'react';\n\nimport { useEndpointLocation } from '@/contexts/EndpointLocationContext';\nimport { generateNextProperties } from '@/openapi/generateNextProperties';\n\nimport { useComponentSchemas } from './useComponentSchemas';\n\nexport function useGenerateNextProperties(schema: ObjectSchema | IncrementalObjectSchema) {\n const componentSchemas = useComponentSchemas();\n const { location } = useEndpointLocation();\n\n return useMemo(() => {\n return generateNextProperties(schema, componentSchemas, location);\n }, [schema, componentSchemas, location]);\n}\n"],"names":["useGenerateNextProperties","schema","componentSchemas","useComponentSchemas","location","useEndpointLocation","useMemo","generateNextProperties"],"mappings":";;;;AAQO,SAASA,EAA0BC,GAAgD;AACxF,QAAMC,IAAmBC,EAAA,GACnB,EAAE,UAAAC,EAAA,IAAaC,EAAA;AAErB,SAAOC,EAAQ,MACNC,EAAuBN,GAAQC,GAAkBE,CAAQ,GAC/D,CAACH,GAAQC,GAAkBE,CAAQ,CAAC;AACzC;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useCallback as p, useEffect as w } from "react";
|
|
2
|
+
const d = ({
|
|
3
|
+
key: y,
|
|
4
|
+
callback: r,
|
|
5
|
+
isSingleKey: h,
|
|
6
|
+
excludedActiveElementId: u,
|
|
7
|
+
excludedActiveElements: f,
|
|
8
|
+
isDisabled: i
|
|
9
|
+
}) => {
|
|
10
|
+
const n = p(
|
|
11
|
+
(s) => {
|
|
12
|
+
if (i) return;
|
|
13
|
+
let t = !1;
|
|
14
|
+
const o = document.activeElement;
|
|
15
|
+
u && (t = !!(o != null && o.id) && u.includes(o.id)), f && !t && (t = f.includes(
|
|
16
|
+
o == null ? void 0 : o.tagName.toLowerCase()
|
|
17
|
+
)), s.key === y && (h || s.metaKey || s.ctrlKey) && !t && (s.preventDefault(), r == null || r());
|
|
18
|
+
},
|
|
19
|
+
[r, y, h, u, f, i]
|
|
20
|
+
);
|
|
21
|
+
w(() => (addEventListener("keydown", n), () => removeEventListener("keydown", n)), [n]);
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
d as useKeyboardShortcut
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=useKeyboardShortcut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboardShortcut.js","sources":["../../src/hooks/useKeyboardShortcut.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, useEffect } from 'react';\n\ntype UseKeyboardShortcutType = {\n key: string;\n callback: (() => void) | (() => Promise<void>) | undefined;\n isSingleKey?: boolean;\n excludedActiveElementId?: string[];\n excludedActiveElements?: (keyof HTMLElementTagNameMap)[];\n isDisabled?: boolean;\n};\n\nexport const useKeyboardShortcut = ({\n key,\n callback,\n isSingleKey,\n excludedActiveElementId,\n excludedActiveElements,\n isDisabled,\n}: UseKeyboardShortcutType) => {\n const onKeypress = useCallback(\n (event: KeyboardEvent) => {\n if (isDisabled) return;\n\n let shouldExclude = false;\n const activeElement = document.activeElement;\n\n if (excludedActiveElementId) {\n shouldExclude = !!activeElement?.id && excludedActiveElementId.includes(activeElement.id);\n }\n\n if (excludedActiveElements && !shouldExclude) {\n shouldExclude = excludedActiveElements.includes(\n \n activeElement?.tagName.toLowerCase() as keyof HTMLElementTagNameMap\n );\n }\n\n const isShortcut = event.key === key && (isSingleKey || event.metaKey || event.ctrlKey);\n if (isShortcut && !shouldExclude) {\n event.preventDefault();\n void callback?.();\n }\n },\n [callback, key, isSingleKey, excludedActiveElementId, excludedActiveElements, isDisabled]\n );\n\n useEffect(() => {\n addEventListener('keydown', onKeypress);\n return () => removeEventListener('keydown', onKeypress);\n }, [onKeypress]);\n};\n"],"names":["useKeyboardShortcut","key","callback","isSingleKey","excludedActiveElementId","excludedActiveElements","isDisabled","onKeypress","useCallback","event","shouldExclude","activeElement","useEffect"],"mappings":";AAaO,MAAMA,IAAsB,CAAC;AAAA,EAClC,KAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,YAAAC;AACF,MAA+B;AAC7B,QAAMC,IAAaC;AAAA,IACjB,CAACC,MAAyB;AACxB,UAAIH,EAAY;AAEhB,UAAII,IAAgB;AACpB,YAAMC,IAAgB,SAAS;AAE/B,MAAIP,MACFM,IAAgB,CAAC,EAACC,KAAA,QAAAA,EAAe,OAAMP,EAAwB,SAASO,EAAc,EAAE,IAGtFN,KAA0B,CAACK,MAC7BA,IAAgBL,EAAuB;AAAA,QAErCM,KAAA,gBAAAA,EAAe,QAAQ;AAAA,MAAY,IAIpBF,EAAM,QAAQR,MAAQE,KAAeM,EAAM,WAAWA,EAAM,YAC7D,CAACC,MACjBD,EAAM,eAAA,GACDP,KAAA,QAAAA;AAAA,IAET;AAAA,IACA,CAACA,GAAUD,GAAKE,GAAaC,GAAyBC,GAAwBC,CAAU;AAAA,EAAA;AAG1F,EAAAM,EAAU,OACR,iBAAiB,WAAWL,CAAU,GAC/B,MAAM,oBAAoB,WAAWA,CAAU,IACrD,CAACA,CAAU,CAAC;AACjB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMDXContent.js","sources":["../../src/hooks/useMDXContent.ts"],"sourcesContent":["'use client';\n\nimport { useContext } from 'react';\n\nimport { MDXContentContext } from '../contexts/MDXContentContext';\n\nexport const useMDXContent = () => useContext(MDXContentContext);\n"],"names":["useMDXContent","useContext","MDXContentContext"],"mappings":";;AAMO,MAAMA,IAAgB,MAAMC,EAAWC,CAAiB;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useMemo as r } from "react";
|
|
2
|
+
import { useApiPlaygroundInputs as t } from "../useApiPlaygroundInputs.js";
|
|
3
|
+
const s = () => {
|
|
4
|
+
const [o] = t();
|
|
5
|
+
return r(() => o, [o]);
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
s as useApiPlaygroundInputs
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useApiPlaygroundInputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApiPlaygroundInputs.js","sources":["../../../src/hooks/useMDXContentController/useApiPlaygroundInputs.ts"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { useApiPlaygroundInputs as useApiPlaygroundInputsCtx } from '@/hooks/useApiPlaygroundInputs';\n\nexport const useApiPlaygroundInputs = () => {\n const [context] = useApiPlaygroundInputsCtx();\n return useMemo(() => {\n return context;\n }, [context]);\n};\n"],"names":["useApiPlaygroundInputs","context","useApiPlaygroundInputsCtx","useMemo"],"mappings":";;AAMO,MAAMA,IAAyB,MAAM;AAC1C,QAAM,CAACC,CAAO,IAAIC,EAAA;AAClB,SAAOC,EAAQ,MACNF,GACN,CAACA,CAAO,CAAC;AACd;"}
|
package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useCallback as a } from "react";
|
|
2
|
+
import { useMDXContent as o } from "../../useMDXContent.js";
|
|
3
|
+
const n = () => {
|
|
4
|
+
const [, e] = o();
|
|
5
|
+
return a(
|
|
6
|
+
(t) => e({
|
|
7
|
+
type: "set_api_base_index",
|
|
8
|
+
payload: t
|
|
9
|
+
}),
|
|
10
|
+
[e]
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
n as useSetApiBaseIndexCallback
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useSetApiBaseIndexCallback.js.map
|
package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSetApiBaseIndexCallback.js","sources":["../../../../src/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.ts"],"sourcesContent":["'use client';\n\nimport { useCallback } from 'react';\n\nimport { useMDXContent } from '@/hooks/useMDXContent';\n\nexport const useSetApiBaseIndexCallback = () => {\n const [, dispatch] = useMDXContent();\n return useCallback(\n (x: number) =>\n dispatch({\n type: 'set_api_base_index',\n payload: x,\n }),\n [dispatch]\n );\n};\n"],"names":["useSetApiBaseIndexCallback","dispatch","useMDXContent","useCallback","x"],"mappings":";;AAMO,MAAMA,IAA6B,MAAM;AAC9C,QAAM,CAAA,EAAGC,CAAQ,IAAIC,EAAA;AACrB,SAAOC;AAAA,IACL,CAACC,MACCH,EAAS;AAAA,MACP,MAAM;AAAA,MACN,SAASG;AAAA,IAAA,CACV;AAAA,IACH,CAACH,CAAQ;AAAA,EAAA;AAEb;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useCallback as a } from "react";
|
|
2
|
+
import { useApiPlaygroundInputs as o } from "../../useApiPlaygroundInputs.js";
|
|
3
|
+
const u = () => {
|
|
4
|
+
const [, p] = o();
|
|
5
|
+
return a(
|
|
6
|
+
(t) => p({
|
|
7
|
+
type: "set_api_playground_inputs",
|
|
8
|
+
payload: t
|
|
9
|
+
}),
|
|
10
|
+
[p]
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
u as useSetApiPlaygroundInputsCallback
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useSetApiPlaygroundInputsCallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSetApiPlaygroundInputsCallback.js","sources":["../../../../src/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.ts"],"sourcesContent":["'use client';\n\nimport { ApiPlaygroundInputs } from '@mintlify/validation';\nimport { useCallback } from 'react';\n\nimport { useApiPlaygroundInputs } from '@/hooks/useApiPlaygroundInputs';\n\nexport const useSetApiPlaygroundInputsCallback = () => {\n const [, dispatch] = useApiPlaygroundInputs();\n return useCallback(\n (inputs: ApiPlaygroundInputs) =>\n dispatch({\n type: 'set_api_playground_inputs',\n payload: inputs,\n }),\n [dispatch]\n );\n};\n"],"names":["useSetApiPlaygroundInputsCallback","dispatch","useApiPlaygroundInputs","useCallback","inputs"],"mappings":";;AAOO,MAAMA,IAAoC,MAAM;AACrD,QAAM,CAAA,EAAGC,CAAQ,IAAIC,EAAA;AACrB,SAAOC;AAAA,IACL,CAACC,MACCH,EAAS;AAAA,MACP,MAAM;AAAA,MACN,SAASG;AAAA,IAAA,CACV;AAAA,IACH,CAACH,CAAQ;AAAA,EAAA;AAEb;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useMemo as c } from "react";
|
|
2
|
+
import { generateOptionLabels as u } from "../openapi/generateOptionLabels.js";
|
|
3
|
+
import { useComponentSchemas as m } from "./useComponentSchemas.js";
|
|
4
|
+
const g = (t) => {
|
|
5
|
+
const n = m();
|
|
6
|
+
return c(() => t ? f(t, n, void 0) : [], [t, n]);
|
|
7
|
+
}, f = (t, n, s) => {
|
|
8
|
+
const i = t.some((e) => e.type === "null"), l = t.every((e) => e.type === "object"), a = u(
|
|
9
|
+
t,
|
|
10
|
+
n,
|
|
11
|
+
l,
|
|
12
|
+
i,
|
|
13
|
+
s
|
|
14
|
+
);
|
|
15
|
+
let o;
|
|
16
|
+
const r = [], p = [];
|
|
17
|
+
for (const e of t)
|
|
18
|
+
e.type === "any" ? o = o ?? e : r.push(e);
|
|
19
|
+
for (const e of a)
|
|
20
|
+
e === "any" ? p.push(null) : p.push(e);
|
|
21
|
+
if (o !== void 0) {
|
|
22
|
+
const e = {
|
|
23
|
+
description: o.description,
|
|
24
|
+
required: o.required
|
|
25
|
+
};
|
|
26
|
+
r.push(
|
|
27
|
+
{ ...e, type: "string" },
|
|
28
|
+
{ ...e, type: "number" },
|
|
29
|
+
{ ...e, type: "boolean" },
|
|
30
|
+
{ ...e, type: "object", properties: {} },
|
|
31
|
+
{ ...e, type: "array", items: [{ type: "any" }] },
|
|
32
|
+
{ ...e, type: "null" }
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return r.map((e, y) => ({
|
|
36
|
+
schema: e,
|
|
37
|
+
label: p[y] ?? e.type
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
g as usePlaygroundSchemaOptions
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=usePlaygroundSchemaOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePlaygroundSchemaOptions.js","sources":["../../src/hooks/usePlaygroundSchemaOptions.ts"],"sourcesContent":["'use client';\n\nimport {\n AnySchema,\n DataSchema,\n DataSchemaArray,\n IncrementalDataSchema,\n IncrementalDataSchemaArray,\n} from '@mintlify/validation';\nimport { useMemo } from 'react';\n\nimport { generateOptionLabels } from '@/openapi/generateOptionLabels';\nimport { ComponentSchemas } from '@/utils/api-reference/getApiReferenceData';\n\nimport { useComponentSchemas } from './useComponentSchemas';\n\nexport type NoAnyDataSchema = Exclude<DataSchema | IncrementalDataSchema, AnySchema>;\nexport type SchemaWithLabelInfo = {\n schema: NoAnyDataSchema;\n label: string;\n};\n\nexport const usePlaygroundSchemaOptions = (\n schemaArray: DataSchemaArray | IncrementalDataSchemaArray | null\n) => {\n const componentSchemas = useComponentSchemas();\n return useMemo(() => {\n if (!schemaArray) return [];\n return getCleanSchemaArray(schemaArray, componentSchemas, undefined);\n }, [schemaArray, componentSchemas]);\n};\n\nconst getCleanSchemaArray = (\n schemaArray: DataSchemaArray | IncrementalDataSchemaArray,\n componentSchemas: ComponentSchemas | undefined,\n userGroups: string[] | undefined\n): SchemaWithLabelInfo[] => {\n const nullable = schemaArray.some((schema) => schema.type === 'null');\n const allObjects = schemaArray.every((schema) => schema.type === 'object');\n\n const typeStrings = generateOptionLabels(\n schemaArray,\n componentSchemas,\n allObjects,\n nullable,\n userGroups,\n true\n );\n\n let firstAnySchema: AnySchema | undefined = undefined;\n\n // filter out all schemas with type `any`, while saving the first instance for meta info\n const filteredSchemaArray: NoAnyDataSchema[] = [];\n const filteredTypeStringArray: (string | null)[] = [];\n for (const schema of schemaArray) {\n if (schema.type === 'any') {\n firstAnySchema = firstAnySchema ?? schema;\n } else {\n filteredSchemaArray.push(schema);\n }\n }\n\n for (const typeString of typeStrings) {\n if (typeString === 'any') {\n filteredTypeStringArray.push(null);\n } else {\n filteredTypeStringArray.push(typeString);\n }\n }\n\n // push a bunch of schemas to represent the `any`\n if (firstAnySchema !== undefined) {\n const baseSchema: Pick<DataSchema, 'description' | 'required'> = {\n description: firstAnySchema.description,\n required: firstAnySchema.required,\n };\n\n // all schemas that aren't added here are subsets of these schemas (eg, integer is just a more restrictive number input)\n filteredSchemaArray.push(\n { ...baseSchema, type: 'string' },\n { ...baseSchema, type: 'number' },\n { ...baseSchema, type: 'boolean' },\n { ...baseSchema, type: 'object', properties: {} },\n { ...baseSchema, type: 'array', items: [{ type: 'any' }] },\n { ...baseSchema, type: 'null' }\n );\n }\n\n const typeLabelMappedSchemaArray = filteredSchemaArray.map((schema, i) => ({\n schema,\n label: filteredTypeStringArray[i] ?? schema.type,\n }));\n\n // return each schema-label pair, just using the type for schemas generated from the `any`\n return typeLabelMappedSchemaArray;\n};\n"],"names":["usePlaygroundSchemaOptions","schemaArray","componentSchemas","useComponentSchemas","useMemo","getCleanSchemaArray","userGroups","nullable","schema","allObjects","typeStrings","generateOptionLabels","firstAnySchema","filteredSchemaArray","filteredTypeStringArray","typeString","baseSchema","i"],"mappings":";;;AAsBO,MAAMA,IAA6B,CACxCC,MACG;AACH,QAAMC,IAAmBC,EAAA;AACzB,SAAOC,EAAQ,MACRH,IACEI,EAAoBJ,GAAaC,GAAkB,MAAS,IAD1C,CAAA,GAExB,CAACD,GAAaC,CAAgB,CAAC;AACpC,GAEMG,IAAsB,CAC1BJ,GACAC,GACAI,MAC0B;AAC1B,QAAMC,IAAWN,EAAY,KAAK,CAACO,MAAWA,EAAO,SAAS,MAAM,GAC9DC,IAAaR,EAAY,MAAM,CAACO,MAAWA,EAAO,SAAS,QAAQ,GAEnEE,IAAcC;AAAA,IAClBV;AAAA,IACAC;AAAA,IACAO;AAAA,IACAF;AAAA,IACAD;AAAA,EAEF;AAEA,MAAIM;AAGJ,QAAMC,IAAyC,CAAA,GACzCC,IAA6C,CAAA;AACnD,aAAWN,KAAUP;AACnB,IAAIO,EAAO,SAAS,QAClBI,IAAiBA,KAAkBJ,IAEnCK,EAAoB,KAAKL,CAAM;AAInC,aAAWO,KAAcL;AACvB,IAAIK,MAAe,QACjBD,EAAwB,KAAK,IAAI,IAEjCA,EAAwB,KAAKC,CAAU;AAK3C,MAAIH,MAAmB,QAAW;AAChC,UAAMI,IAA2D;AAAA,MAC/D,aAAaJ,EAAe;AAAA,MAC5B,UAAUA,EAAe;AAAA,IAAA;AAI3B,IAAAC,EAAoB;AAAA,MAClB,EAAE,GAAGG,GAAY,MAAM,SAAA;AAAA,MACvB,EAAE,GAAGA,GAAY,MAAM,SAAA;AAAA,MACvB,EAAE,GAAGA,GAAY,MAAM,UAAA;AAAA,MACvB,EAAE,GAAGA,GAAY,MAAM,UAAU,YAAY,CAAA,EAAC;AAAA,MAC9C,EAAE,GAAGA,GAAY,MAAM,SAAS,OAAO,CAAC,EAAE,MAAM,MAAA,CAAO,EAAA;AAAA,MACvD,EAAE,GAAGA,GAAY,MAAM,OAAA;AAAA,IAAO;AAAA,EAElC;AAQA,SANmCH,EAAoB,IAAI,CAACL,GAAQS,OAAO;AAAA,IACzE,QAAAT;AAAA,IACA,OAAOM,EAAwBG,CAAC,KAAKT,EAAO;AAAA,EAAA,EAC5C;AAIJ;"}
|