@mintlify/msft-sdk 1.1.62 → 1.1.64

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.
Files changed (169) hide show
  1. package/dist/api-playground/ApiPlayground/Response/DownloadFileButton.js +6 -5
  2. package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js +13 -12
  3. package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js +8 -7
  4. package/dist/api-playground/ApiPlayground/Response/ResponseTable.js +3 -2
  5. package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js +9 -8
  6. package/dist/api-playground/ApiPlayground/Response/index.js +4 -3
  7. package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js +42 -21
  8. package/dist/api-playground/ApiPlayground/components/ParamFieldWrapper.js +13 -9
  9. package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js +7 -6
  10. package/dist/api-playground/ApiPlayground/components/SendPill.js +3 -2
  11. package/dist/api-playground/ApiPlayground/components/TypeDropdown.js +6 -5
  12. package/dist/api-playground/EndpointFields/ParamFields/ExampleDescription.js +3 -2
  13. package/dist/api-playground/EndpointFields/components/Description.js +6 -5
  14. package/dist/api-playground/EndpointFields/components/OptionDropdown.js +9 -8
  15. package/dist/api-playground/EndpointFields/components/SectionHeading.js +8 -7
  16. package/dist/api-playground-2/ApiExamples.js +19 -20
  17. package/dist/api-playground-2/ApiFields.js +20 -247
  18. package/dist/api-playground-2/EndpointHeader.js +59 -47
  19. package/dist/api-playground-2/OperationPage.js +70 -67
  20. package/dist/api-playground-2/Playground.js +67 -83
  21. package/dist/api-playground-2/SchemaPage.js +22 -9
  22. package/dist/api-playground-2/components/EndpointFields/Body.js +40 -0
  23. package/dist/api-playground-2/components/EndpointFields/Parameters.js +90 -0
  24. package/dist/api-playground-2/components/EndpointFields/Response.js +146 -0
  25. package/dist/api-playground-2/components/EndpointFields/Security.js +88 -0
  26. package/dist/api-playground-2/components/EndpointFields/fields/ArrayParamField.js +93 -0
  27. package/dist/api-playground-2/components/EndpointFields/fields/Enum.js +29 -11
  28. package/dist/api-playground-2/components/EndpointFields/fields/ObjectParamField.js +145 -0
  29. package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js +60 -48
  30. package/dist/api-playground-2/components/EndpointFields/fields/SchemaField.js +230 -0
  31. package/dist/api-playground-2/components/Example/GeneratedRequestExample.js +93 -89
  32. package/dist/api-playground-2/components/Example/GeneratedResponseExample.js +18 -17
  33. package/dist/api-playground-2/components/Example/RequestExample.js +92 -93
  34. package/dist/api-playground-2/components/Example/ResponseExample.js +19 -15
  35. package/dist/api-playground-2/components/Request/ParameterSection.js +20 -18
  36. package/dist/api-playground-2/components/Request/SecuritySection.js +53 -43
  37. package/dist/api-playground-2/components/Request/inputs/ArrayInput.js +89 -40
  38. package/dist/api-playground-2/components/Request/inputs/DifferentiatedInput.js +12 -12
  39. package/dist/api-playground-2/components/Request/inputs/FileInput.js +16 -15
  40. package/dist/api-playground-2/components/Request/inputs/InputContainer.js +76 -57
  41. package/dist/api-playground-2/components/Request/inputs/NumberInput.js +10 -9
  42. package/dist/api-playground-2/components/Request/inputs/ObjectInput.js +98 -80
  43. package/dist/api-playground-2/components/Request/inputs/OneOfInput.js +55 -47
  44. package/dist/api-playground-2/components/Request/inputs/SelectInput.js +18 -17
  45. package/dist/api-playground-2/components/Request/inputs/StringInput.js +19 -18
  46. package/dist/api-playground-2/components/Request/inputs/TextInput.js +12 -11
  47. package/dist/api-playground-2/components/SendPillWrapper.js +35 -0
  48. package/dist/api-playground-2/contexts/ApiPlaygroundContext.js +3 -5
  49. package/dist/api-playground-2/generators/createCookies.js +23 -0
  50. package/dist/api-playground-2/generators/createHeaders.js +53 -36
  51. package/dist/api-playground-2/generators/createQueryString.js +30 -0
  52. package/dist/api-playground-2/generators/generateAuthPlaceholder.js +14 -0
  53. package/dist/api-playground-2/generators/generateInteractiveCodeSample.js +27 -25
  54. package/dist/api-playground-2/generators/generateRequest.js +47 -51
  55. package/dist/api-playground-2/generators/generateResponseExampleMap.js +15 -11
  56. package/dist/api-playground-2/generators/generateSnippetMap.js +13 -11
  57. package/dist/api-playground-2/hooks/useCopyPathWithInputs.js +11 -11
  58. package/dist/api-playground-2/hooks/useInitializeInputs.js +185 -88
  59. package/dist/api-playground-2/hooks/usePlaygroundInputsStore.js +70 -25
  60. package/dist/api-playground-2/hooks/useSelectedBaseUrl.js +13 -0
  61. package/dist/api-playground-2/hooks/useSelectedExample.js +10 -0
  62. package/dist/api-playground-2/hooks/useSelectedRequestBodyContentType.js +12 -0
  63. package/dist/api-playground-2/hooks/useSelectedResponseContentType.js +12 -0
  64. package/dist/api-playground-2/hooks/useSelectedSecurityOption.js +31 -0
  65. package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +114 -101
  66. package/dist/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js +23 -32
  67. package/dist/api-playground-2/schemaGraph/addTypeLabelsToSchema.js +50 -0
  68. package/dist/api-playground-2/schemaGraph/addUniqueKeysToSchema.js +40 -24
  69. package/dist/api-playground-2/schemaGraph/getExampleBodyInputs.js +94 -0
  70. package/dist/api-playground-2/schemaGraph/getSchemaGraphOperationData.js +56 -50
  71. package/dist/api-playground-2/schemaGraph/processExamples.js +117 -52
  72. package/dist/api-playground-2/schemaGraph/processSchema.js +10 -0
  73. package/dist/api-playground-2/schemaGraph/processSecurityOptions.js +58 -28
  74. package/dist/api-playground-2/schemaGraph/reduceCompositions.js +220 -181
  75. package/dist/api-playground-2/schemaGraph/resolveOperationWithDependencies.js +128 -89
  76. package/dist/api-playground-2/schemaGraph/resolveSchemaWithDependencies.js +15 -16
  77. package/dist/api-playground-2/schemaGraph/sortSchemaByRequired.js +14 -12
  78. package/dist/api-playground-2/schemaGraph/utils.js +185 -147
  79. package/dist/common/guards.js +11 -19
  80. package/dist/components/Api/Expandable.js +10 -9
  81. package/dist/components/Api/Param.js +11 -13
  82. package/dist/components/Api/dropdown-menu.js +10 -9
  83. package/dist/components/apiPage.js +125 -0
  84. package/dist/components/content-components/code-group.js +4 -4
  85. package/dist/components/docsPage.js +54 -56
  86. package/dist/contexts/EndpointLocationContext.js +3 -3
  87. package/dist/hooks/useApiParamFieldOption.js +10 -0
  88. package/dist/hooks/useEndpoint.js +3 -3
  89. package/dist/hooks/useKeyboardShortcut.js +13 -13
  90. package/dist/hooks/useSendPlaygroundRequest.js +14 -146
  91. package/dist/index.d.ts +80 -60
  92. package/dist/index.js +99 -101
  93. package/dist/openapi/generateTypeStringFromSchema.js +2 -31
  94. package/dist/plugins/sanitize/rehype-pre-to-mdx-fence.js +13 -13
  95. package/dist/styles.css +1 -1
  96. package/package.json +1 -1
  97. package/dist/api-playground/ApiPlayground/Request/BodySection.js +0 -64
  98. package/dist/api-playground/ApiPlayground/Request/ParameterSection.js +0 -32
  99. package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js +0 -201
  100. package/dist/api-playground/ApiPlayground/Request/SecuritySection.js +0 -146
  101. package/dist/api-playground/ApiPlayground/Request/ServerSection.js +0 -30
  102. package/dist/api-playground/ApiPlayground/Request/index.js +0 -43
  103. package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js +0 -93
  104. package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js +0 -90
  105. package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js +0 -62
  106. package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js +0 -33
  107. package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js +0 -61
  108. package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js +0 -109
  109. package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js +0 -87
  110. package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js +0 -61
  111. package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js +0 -54
  112. package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js +0 -67
  113. package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js +0 -44
  114. package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js +0 -42
  115. package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js +0 -43
  116. package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js +0 -38
  117. package/dist/api-playground/ApiPlayground/components/InputContainer.js +0 -128
  118. package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js +0 -59
  119. package/dist/api-playground/ApiPlayground/components/PathHeader.js +0 -162
  120. package/dist/api-playground/ApiPlayground/components/TrashButton.js +0 -26
  121. package/dist/api-playground/ApiPlayground/index.js +0 -67
  122. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js +0 -19
  123. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js +0 -18
  124. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js +0 -28
  125. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js +0 -5
  126. package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js +0 -13
  127. package/dist/api-playground/EndpointFields/index.js +0 -7
  128. package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js +0 -87
  129. package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js +0 -89
  130. package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js +0 -121
  131. package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js +0 -74
  132. package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js +0 -252
  133. package/dist/common/potentiallyParseOpenApiString.js +0 -24
  134. package/dist/common/replaceSlashIndex.js +0 -6
  135. package/dist/common/slugToTitle.js +0 -10
  136. package/dist/constants/prism-languages.js +0 -19
  137. package/dist/contexts/ApiPlaygroundInputsContext.js +0 -17
  138. package/dist/contexts/MDXContentContext.js +0 -17
  139. package/dist/hooks/useApiPlaygroundInputs.js +0 -6
  140. package/dist/hooks/useApiPlaygroundPrefillExamples.js +0 -39
  141. package/dist/hooks/useBaseUrlOptions.js +0 -18
  142. package/dist/hooks/useComponentSchemas.js +0 -9
  143. package/dist/hooks/useGenerateNextAdditionalProperties.js +0 -11
  144. package/dist/hooks/useGenerateNextItems.js +0 -11
  145. package/dist/hooks/useGenerateNextProperties.js +0 -11
  146. package/dist/hooks/useMDXContent.js +0 -6
  147. package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js +0 -9
  148. package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js +0 -15
  149. package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js +0 -15
  150. package/dist/hooks/usePlaygroundSchemaOptions.js +0 -42
  151. package/dist/hooks/usePrefilledInputs/index.js +0 -65
  152. package/dist/hooks/usePrefilledInputs/storedServerVariables.js +0 -29
  153. package/dist/hooks/useSecurityOption.js +0 -10
  154. package/dist/hooks/useSetDefaultValue.js +0 -63
  155. package/dist/openapi/filterEnums.js +0 -20
  156. package/dist/openapi/generateNextAdditionalProperties.js +0 -7
  157. package/dist/openapi/generateNextItems.js +0 -7
  158. package/dist/openapi/generateNextProperties.js +0 -23
  159. package/dist/openapi/generateOptionLabels.js +0 -20
  160. package/dist/openapi/generateSimpleLabels.js +0 -4
  161. package/dist/openapi/getAuthFilteredSchemaArray.js +0 -18
  162. package/dist/paths/isEqualIgnoringLeadingSlash.js +0 -21
  163. package/dist/paths/optionallyRemoveLeadingSlash.js +0 -6
  164. package/dist/paths/optionallyRemoveTrailingSlash.js +0 -6
  165. package/dist/utils/api-playground/defaults.js +0 -15
  166. package/dist/utils/api-playground/paramFieldDefaults.js +0 -10
  167. package/dist/utils/api-reference/getFilteredSecurityOptions.js +0 -4
  168. package/dist/utils/api-reference/getNextPropertiesByType.js +0 -5
  169. package/dist/utils/flattenObject.js +0 -10
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { ApiPlaygroundDisplayType } from '@mintlify/models';
2
1
  import { ApiPlaygroundInputs } from '@mintlify/validation';
3
2
  import { ApiPlaygroundResultType } from '@mintlify/models';
4
3
  import { AsyncAPIDocumentInterface } from '@mintlify/common';
@@ -22,6 +21,7 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
22
21
  import { MdxExtracts as MdxExtracts_2 } from '@mintlify/common';
23
22
  import { MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
24
23
  import { MintConfig } from '@mintlify/models';
24
+ import { NamedExoticComponent } from 'react';
25
25
  import { Node as Node_2 } from 'unist';
26
26
  import { Node as Node_3 } from 'hast';
27
27
  import { OpenApiMetadata } from '@mintlify/models';
@@ -48,6 +48,7 @@ import { StoreApi } from 'zustand';
48
48
  import { Text as Text_2 } from 'hast';
49
49
  import { TrieveType } from '@mintlify/validation';
50
50
  import { UseBoundStore } from 'zustand';
51
+ import { UserInfoInputs } from '@mintlify/validation';
51
52
  import { UUID } from '@mintlify/validation';
52
53
 
53
54
  export declare const addApiReferenceDataFromMdxAndDocsConfig: ({ pageMetadata, apiReferenceData2, mdxExtracts, docsConfig, }: {
@@ -82,7 +83,7 @@ export declare interface AnchorConfig {
82
83
  }
83
84
 
84
85
  export declare const Api: ({ children }: {
85
- children: ReactNode;
86
+ children?: ReactNode | undefined;
86
87
  }) => JSX_2.Element | null;
87
88
 
88
89
  export declare const ApiExamples: ({ className, isModal, apiReferenceData, noInputs }: ApiExamplesProps) => JSX_2.Element;
@@ -94,47 +95,38 @@ declare type ApiExamplesProps = {
94
95
  noInputs?: boolean;
95
96
  };
96
97
 
97
- export declare function ApiFields({ pageMetadata }: {
98
- pageMetadata: PageMetaTags;
99
- }): JSX_2.Element;
100
-
101
- export declare const ApiPlayground: ({ endpoint, display, pathname }: ApiPlaygroundParams) => JSX_2.Element;
98
+ export declare const ApiFields: NamedExoticComponent< {
99
+ pageMetadata: PageMetaTags;
100
+ }>;
102
101
 
103
- export declare const ApiPlaygroundContext: Context<ApiPlaygroundContextType>;
102
+ export declare function ApiPage({ theme, className, pathname, markdownContent, allPages, baseUrl, LinkComponent, contextMenu, apiReferenceData, pageMetadata }: ApiPageProps): JSX_2.Element;
104
103
 
105
- export declare const ApiPlaygroundContextLegacy: Context<ApiPlaygroundContextTypeLegacy>;
104
+ declare interface ApiPageProps {
105
+ theme: 'light' | 'dark';
106
+ className?: string;
107
+ pathname: string;
108
+ markdownContent?: string;
109
+ allPages?: LlmsPageConfig[];
110
+ baseUrl?: string;
111
+ LinkComponent?: LinkComponent;
112
+ contextMenu?: PageContextMenuConfig;
113
+ apiReferenceData?: ApiReferenceDataV2;
114
+ pageMetadata: PageMetaTags;
115
+ }
106
116
 
107
- export declare type ApiPlaygroundContextType = {
108
- isSending?: boolean;
109
- sendRequest?: () => void;
110
- isPlaygroundExpanded: boolean;
111
- result?: ApiPlaygroundResultType;
112
- selectedBaseUrlIndex: number;
113
- setSelectedBaseUrlIndex?: (index: number) => void;
114
- setIsPlaygroundExpanded?: (expanded: boolean) => void;
115
- baseUrlOptions?: string[];
116
- selectedExampleIndex?: number;
117
- setSelectedExampleIndex?: (index: number) => void;
118
- };
117
+ declare const ApiPlaygroundContext: Context<ApiPlaygroundContextType>;
118
+ export { ApiPlaygroundContext }
119
+ export { ApiPlaygroundContext as ApiPlaygroundContextLegacy }
119
120
 
120
- export declare type ApiPlaygroundContextTypeLegacy = {
121
+ declare type ApiPlaygroundContextType = {
121
122
  isSending?: boolean;
122
123
  sendRequest?: () => void;
123
124
  isPlaygroundExpanded: boolean;
124
125
  result?: ApiPlaygroundResultType;
125
- selectedBaseUrlIndex: number;
126
- setSelectedBaseUrlIndex?: (index: number) => void;
127
126
  setIsPlaygroundExpanded?: (expanded: boolean) => void;
128
- baseUrlOptions?: string[];
129
- selectedExampleIndex?: number;
130
- setSelectedExampleIndex?: (index: number) => void;
131
- };
132
-
133
- declare type ApiPlaygroundParams = {
134
- endpoint: Endpoint;
135
- display: ApiPlaygroundDisplayType;
136
- pathname: string;
137
127
  };
128
+ export { ApiPlaygroundContextType }
129
+ export { ApiPlaygroundContextType as ApiPlaygroundContextTypeLegacy }
138
130
 
139
131
  export declare const ApiReferenceContext: Context<ApiReferenceContextType>;
140
132
 
@@ -171,8 +163,8 @@ export declare interface ApiReferenceDataV2 {
171
163
  schemaData?: SchemaV2;
172
164
  dependencies?: {
173
165
  parameters?: Record<UUID, ParameterObject>;
174
- requestBody?: RequestBodyObject;
175
- responses?: Record<UUID, ResponseObject>;
166
+ requestBody?: ResolvedRequestBody;
167
+ responses?: ResolvedResponses;
176
168
  servers: Record<UUID, ServerObject>;
177
169
  security: Record<UUID, ResolvedSecurityObject>;
178
170
  processedSecurityOptions?: ProcessedSecurityOption[];
@@ -450,7 +442,7 @@ export declare interface DocsLayoutTelemetry {
450
442
  * />
451
443
  * ```
452
444
  */
453
- export declare function DocsPage({ payload, toc, navTree, activeHref, theme, className, pathname, markdownContent, allPages, baseUrl, bottomLinks, LinkComponent, localization, telemetry, contextMenu, apiReferenceData2, }: DocsPagePropsWithCustomization): JSX_2.Element;
445
+ export declare function DocsPage({ payload, toc, navTree, activeHref, theme, className, pathname, markdownContent, allPages, baseUrl, bottomLinks, LinkComponent, localization, telemetry, contextMenu, }: DocsPagePropsWithCustomization): JSX_2.Element;
454
446
 
455
447
  /**
456
448
  * Localization strings for DocsPage component
@@ -483,7 +475,6 @@ export declare interface DocsPageProps {
483
475
  baseUrl?: string;
484
476
  bottomLinks?: BottomLinkConfig[];
485
477
  LinkComponent?: LinkComponent;
486
- apiReferenceData2?: any;
487
478
  }
488
479
 
489
480
  /**
@@ -521,16 +512,13 @@ export declare type ElementType = {
521
512
  tagName?: string;
522
513
  };
523
514
 
524
- export declare const EndpointFields: () => JSX_2.Element | null;
525
-
526
- export declare const EndpointHeader: ({ onCopy, baseUrlOptions, selectedBaseUrlIndex, setSelectedBaseUrlIndex, isCopiedActive, display, path, method, onBaseUrlChange, isInPlaygroundModal, }: EndpointHeaderProps) => JSX_2.Element;
515
+ export declare const EndpointHeader: ({ baseUrl, baseUrlOptions, selectedBaseUrlIndex, setSelectedBaseUrlIndex, display, path, method, onBaseUrlChange, isInPlaygroundModal, }: EndpointHeaderProps) => JSX_2.Element;
527
516
 
528
517
  declare type EndpointHeaderProps = {
529
- onCopy: () => void;
518
+ baseUrl: string;
530
519
  baseUrlOptions: string[];
531
520
  selectedBaseUrlIndex: number;
532
521
  setSelectedBaseUrlIndex: (index: number) => void;
533
- isCopiedActive: boolean;
534
522
  isInPlaygroundModal: boolean;
535
523
  display: 'simple' | 'none' | 'interactive';
536
524
  path: string;
@@ -706,7 +694,7 @@ declare interface NavTreeProps {
706
694
  export declare const OperationPage: ({ apiReferenceData, operation, children, }: {
707
695
  apiReferenceData: ApiReferenceDataV2;
708
696
  operation: OperationV2;
709
- children: ReactNode;
697
+ children?: ReactNode | undefined;
710
698
  }) => JSX_2.Element;
711
699
 
712
700
  export declare type OperationV2 = Operation & {
@@ -719,13 +707,14 @@ export declare type OperationV2 = Operation & {
719
707
  requestExamples?: CodeExample[];
720
708
  responseExamples?: CodeExample[];
721
709
  codeSamples?: CodeSample[];
722
- requestExampleType?: 'mdx' | 'webhook' | 'codeSamples' | 'generated';
710
+ requestExampleType?: 'mdx' | 'webhook' | 'codeSamples' | 'generated' | 'examples';
723
711
  requestExampleLanguages?: string[];
724
712
  requiredOnlyExamples?: boolean;
725
713
  responseExampleType?: 'mdx' | 'generated';
726
714
  prefillPlaygroundWithExample?: boolean;
727
- prefillPlaygroundExamples?: ApiPlaygroundInputs[];
715
+ prefillPlaygroundExamples?: Record<string, PlaygroundInputValue>[];
728
716
  disableProxy?: boolean;
717
+ userInfoPlaygroundInputs?: UserInfoInputs;
729
718
  };
730
719
 
731
720
  export declare const PageContext: Context<PageContextType>;
@@ -806,17 +795,28 @@ export declare interface PlainTextPageProps {
806
795
  export declare const Playground: ({ isPlaygroundExpanded, setIsPlaygroundExpanded, baseUrl, baseUrlOptions, apiReferenceData, }: PlaygroundProps) => JSX_2.Element | null;
807
796
 
808
797
  declare interface PlaygroundInputsState {
798
+ apiReferenceData: ApiReferenceDataV2 | undefined;
809
799
  inputs: Record<string, PlaygroundInputValue>;
810
- initialize: (initialValues: Record<string, PlaygroundInputValue>) => void;
800
+ initializeInputs: (initialValues: Record<string, PlaygroundInputValue>) => void;
801
+ initializeApiReferenceData: (apiReferenceData: ApiReferenceDataV2) => void;
811
802
  setInput: (name: string, value: PlaygroundInputValue) => void;
812
803
  setInputs: (inputs: Record<string, PlaygroundInputValue>) => void;
813
804
  replaceInputs: (inputs: Record<string, PlaygroundInputValue>) => void;
805
+ deleteInput: (name: string) => void;
814
806
  getInput: (name: string) => PlaygroundInputValue;
815
807
  getApiPlaygroundInputs: () => ApiPlaygroundInputs;
816
808
  clear: () => void;
817
809
  reset: () => void;
810
+ selectedBaseUrlIndex: number;
811
+ setSelectedBaseUrlIndex: (index: number) => void;
818
812
  selectedSecurityOptionIndex: number;
819
813
  setSelectedSecurityOptionIndex: (index: number) => void;
814
+ selectedExampleIndex: number;
815
+ setSelectedExampleIndex: (index: number) => void;
816
+ selectedRequestBodyContentTypeIndex: number;
817
+ setSelectedRequestBodyContentTypeIndex: (index: number) => void;
818
+ selectedResponseContentTypeIndex: number;
819
+ setSelectedResponseContentTypeIndex: (index: number) => void;
820
820
  }
821
821
 
822
822
  declare type PlaygroundInputValue = unknown;
@@ -830,8 +830,15 @@ declare type PlaygroundProps = {
830
830
  };
831
831
 
832
832
  export declare type ProcessedSecurityOption = {
833
+ schemes: Array<ProcessedSecurityScheme>;
834
+ title: string;
835
+ };
836
+
837
+ declare type ProcessedSecurityScheme = {
833
838
  scheme: SecuritySchemeAndScope;
834
839
  schema: SchemaObject;
840
+ schemeName: string;
841
+ name: string;
835
842
  };
836
843
 
837
844
  export declare const processSecurityOptions: (apiReferenceData: ApiReferenceDataV2) => ProcessedSecurityOption[];
@@ -860,6 +867,14 @@ export declare function remarkHeadingIds(): (tree: Root) => void;
860
867
 
861
868
  export declare function removeHtmlComments(root: Root_2): void;
862
869
 
870
+ declare type ResolvedRequestBody = RequestBodyObject & {
871
+ exampleType?: 'generated' | 'examples';
872
+ };
873
+
874
+ declare type ResolvedResponses = Record<UUID, ResponseObject & {
875
+ exampleType?: 'generated' | 'examples';
876
+ }>;
877
+
863
878
  /**
864
879
  * SchemaObject after being processed by the various transformations in `resolveOperationWithDependencies`.
865
880
  * This is the type of object that all the API UI components should be consuming. Any properties that
@@ -882,6 +897,7 @@ export declare type ResolvedSchemaObject = SchemaObject & {
882
897
  isCircular?: boolean;
883
898
  type?: DifferentiatedType;
884
899
  [CIRCULAR_REF_KEY]?: UUID;
900
+ typeLabel?: string;
885
901
  };
886
902
 
887
903
  export declare type ResolvedSecurityObject = {
@@ -901,6 +917,8 @@ export declare type SchemaGeneratedExample = {
901
917
  value: unknown;
902
918
  };
903
919
 
920
+ export { SchemaGraphData }
921
+
904
922
  export declare const SchemaPage: ({ apiReferenceData, children, }: {
905
923
  apiReferenceData: ApiReferenceDataV2;
906
924
  children: ReactNode;
@@ -991,30 +1009,32 @@ export declare const useCopyPathWithInputs: ({ path, baseUrl }: {
991
1009
  }) => string;
992
1010
 
993
1011
  /**
994
- * CLANKED
995
- * Syncs playground state with URL pathname changes.
1012
+ * RE-CLANKED BUT BETTER THIS TIME
1013
+ * Simplified playground initialization hook.
996
1014
  *
997
- * This hook implements the following behavior:
998
- * - When the pathname changes, it resets the playground inputs
999
- * - After reset, it initializes with the new default values for the current endpoint
1000
- * - When playground closes without pathname change, state is preserved
1001
- * - Query parameter changes (like ?playground=open) do NOT reset the state
1015
+ * Assumes the Playground component remounts for each new page/endpoint,
1016
+ * so we don't need complex pathname tracking.
1002
1017
  *
1003
- * Uses refs to track previous pathname to avoid unnecessary resets.
1018
+ * Handles:
1019
+ * - Initial mount: Reset and initialize with defaults
1020
+ * - Credentials loading: Update inputs when credentials load from localStorage
1021
+ * - Example switching: Handled via selectedExampleIndex prop changes
1004
1022
  */
1005
- export declare function useInitializeInputs({ apiReferenceData, selectedBaseUrlIndex, selectedExampleIndex, selectedRequestBodyContentTypeIndex, }: UsePlaygroundStateSyncProps): void;
1006
-
1007
- export declare function useMarkdownCopy(pathname: string): void;
1023
+ export declare function useInitializeInputs({ apiReferenceData, selectedBaseUrlIndex, selectedExampleIndex, selectedRequestBodyContentTypeIndex, locallyStoredCredentials, serverInputs, }: UseInitializeInputsProps): void;
1008
1024
 
1009
- export declare const usePlaygroundInputsStore: UseBoundStore<StoreApi<PlaygroundInputsState>>;
1010
-
1011
- declare interface UsePlaygroundStateSyncProps {
1025
+ declare interface UseInitializeInputsProps {
1012
1026
  apiReferenceData: ApiReferenceDataV2;
1013
1027
  selectedBaseUrlIndex: number;
1014
1028
  selectedExampleIndex: number;
1015
1029
  selectedRequestBodyContentTypeIndex: number;
1030
+ locallyStoredCredentials: Record<string, any> | undefined;
1031
+ serverInputs: Record<string, string> | undefined;
1016
1032
  }
1017
1033
 
1034
+ export declare function useMarkdownCopy(pathname: string): void;
1035
+
1036
+ export declare const usePlaygroundInputsStore: UseBoundStore<StoreApi<PlaygroundInputsState>>;
1037
+
1018
1038
  export declare const useSelectedSecurityOption: () => {
1019
1039
  selectedSecurityOptionIndex: number;
1020
1040
  setSelectedSecurityOptionIndex: (index: number) => void;
package/dist/index.js CHANGED
@@ -3,14 +3,14 @@ import { DocsLayout as p } from "./components/docsLayout.js";
3
3
  import { MDXRenderer as a } from "./components/mdx-renderer.js";
4
4
  import { PlainTextPage as n } from "./components/plain-text-page.js";
5
5
  import { createDefaultComponents as l, defaultComponents as i } from "./components/content-components/default-components.js";
6
- import { ComponentsProvider as s, useComponents as C } from "./context/components-context.js";
6
+ import { ComponentsProvider as d, useComponents as C } from "./context/components-context.js";
7
7
  import { NavTree as P } from "./components/nav-tree/index.js";
8
- import { useApiReference as c } from "./components/Api/ApiReferenceProvider.js";
8
+ import { useApiReference as u } from "./components/Api/ApiReferenceProvider.js";
9
9
  import { ApiReferenceContext as T, ApiReferenceContext2 as b, ApiReferenceProvider as v, ApiReferenceProvider2 as A, DeploymentMetadataContext as H, DeploymentMetadataProvider as h, DocsConfigContext as D, DocsConfigProvider as R, PageContext as M, PageProvider as k } from "./contexts/ConfigContext.js";
10
10
  import { TableOfContents as w } from "./components/toc/index.js";
11
- import { PivotAwareTOC as L } from "./components/toc/pivot-aware-toc.js";
11
+ import { PivotAwareTOC as F } from "./components/toc/pivot-aware-toc.js";
12
12
  import { PageContextMenu as N } from "./components/page-context-menu.js";
13
- import { copyMarkdownToClipboard as O, getPageMarkdown as Z, useMarkdownCopy as z } from "./hooks/useMarkdownCopy.js";
13
+ import { copyMarkdownToClipboard as Z, getPageMarkdown as z, useMarkdownCopy as E } from "./hooks/useMarkdownCopy.js";
14
14
  import { generateLlmsFullTxt as X, generateLlmsTxt as q } from "./utils/generate-llms-txt.js";
15
15
  import { getNodeText as J } from "./utils/get-node-text.js";
16
16
  import { capitalize as j } from "./utils/string.js";
@@ -22,150 +22,148 @@ import { serializeMdx as pe } from "./parser/serialize-mdx.js";
22
22
  import { extractHeadings as ae } from "./plugins/extract-headings.js";
23
23
  import { rehypeRemoveHtmlComments as ne, removeHtmlComments as fe } from "./plugins/sanitize/remove-html-comments.js";
24
24
  import { Api as ie } from "./api-playground-2/Api.js";
25
- import { OperationPage as se } from "./api-playground-2/OperationPage.js";
25
+ import { OperationPage as de } from "./api-playground-2/OperationPage.js";
26
26
  import { SchemaPage as ge } from "./api-playground-2/SchemaPage.js";
27
- import { ApiExamples as ue } from "./api-playground-2/ApiExamples.js";
27
+ import { ApiExamples as ce } from "./api-playground-2/ApiExamples.js";
28
28
  import { ApiFields as ye } from "./api-playground-2/ApiFields.js";
29
29
  import { Playground as be } from "./api-playground-2/Playground.js";
30
30
  import { EndpointHeader as Ae } from "./api-playground-2/EndpointHeader.js";
31
- import { ApiPlaygroundContext as he } from "./api-playground-2/contexts/ApiPlaygroundContext.js";
32
- import { usePlaygroundInputsStore as Re, useSelectedSecurityOption as Me } from "./api-playground-2/hooks/usePlaygroundInputsStore.js";
31
+ import { ApiPlaygroundContext as he, ApiPlaygroundContext as De } from "./api-playground-2/contexts/ApiPlaygroundContext.js";
32
+ import { usePlaygroundInputsStore as Me } from "./api-playground-2/hooks/usePlaygroundInputsStore.js";
33
33
  import { useSendPlaygroundRequest as Se } from "./api-playground-2/hooks/useSendPlaygroundRequest.js";
34
- import { useInitializeInputs as Fe } from "./api-playground-2/hooks/useInitializeInputs.js";
34
+ import { useInitializeInputs as Le } from "./api-playground-2/hooks/useInitializeInputs.js";
35
35
  import { useCopyPathWithInputs as Ie } from "./api-playground-2/hooks/useCopyPathWithInputs.js";
36
- import { addApiReferenceDataFromMdxAndDocsConfig as Ee } from "./api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js";
37
- import { processSecurityOptions as Ze } from "./api-playground-2/schemaGraph/processSecurityOptions.js";
38
- import { getApiReferenceDataFromGraph as Be } from "./api-playground-2/schemaGraph/getApiReferenceDataFromGraph.js";
39
- import { ApiPlayground as qe } from "./api-playground/ApiPlayground/index.js";
40
- import { ApiPlaygroundContext as Je } from "./api-playground/ApiPlayground/ApiPlaygroundContext.js";
41
- import { default as je } from "./api-playground/EndpointFields/index.js";
42
- import { CodeBlock as Qe } from "./components/content-components/code-block.js";
43
- import { Heading as Ve } from "./components/content-components/heading.js";
44
- import { Link as _e } from "./components/content-components/link.js";
45
- import { Callout as eo } from "./components/content-components/callouts.js";
46
- import { ZonePivot as ro } from "./components/content-components/zone-pivots/zone-pivot.js";
47
- import { ZoneTarget as po } from "./components/content-components/zone-pivots/zone-target.js";
48
- import { ZonePivotProvider as ao } from "./components/content-components/zone-pivots/zone-pivot-context.js";
49
- import { ZonePivotSelector as no } from "./components/content-components/zone-pivots/zone-pivot-selector.js";
50
- import { ParamName as lo } from "./components/content-components/param-name.js";
51
- import { Tabs as so } from "./components/content-components/tabs/tabs.js";
52
- import { Tab as go } from "./components/content-components/tabs/tab.js";
53
- import { Details as uo, Summary as co } from "./components/content-components/details/details.js";
54
- import { Table as To, TableBody as bo, TableCaption as vo, TableCell as Ao, TableFooter as Ho, TableHead as ho, TableHeader as Do, TableRow as Ro } from "./components/content-components/table/index.js";
55
- import { LaTeX as ko } from "./components/content-components/latex.js";
56
- import { allComponents as wo } from "./components/content-components/all-components.js";
57
- import { Home as Lo } from "./components/content-components/home.js";
58
- import { MobileNavTree as No } from "./components/nav-tree/mobile-nav.js";
59
- import { rehypeCodeblocks as Oo } from "./plugins/rehype/rehype-code-blocks.js";
60
- import { remarkHeadingIds as zo } from "./plugins/remark/remark-heading-ids.js";
61
- import { sanitizePreTags as Xo } from "./plugins/sanitize/rehype-pre-to-mdx-fence.js";
62
- import { rehypeCallouts as Go } from "./plugins/sanitize/rehype-callouts.js";
63
- import { rehypeParamName as Wo } from "./plugins/sanitize/rehype-param-name.js";
64
- import { rehypeTabs as Ko } from "./plugins/sanitize/rehype-tabs.js";
65
- import { rehypeDetails as Uo } from "./plugins/sanitize/rehype-details.js";
66
- import { rehypeHeadingIds as Yo } from "./plugins/sanitize/rehype-heading-ids.js";
67
- import { rehypeZonePivots as $o } from "./plugins/sanitize/rehype-zone-pivots.js";
68
- import { mdxJsxFlowElementHandler as or, rehypeRemark as rr } from "./plugins/sanitize/rehype-remark.js";
69
- import { rehypeLatex as pr } from "./plugins/sanitize/rehype-latex.js";
70
- import { tableCellHandler as ar, tableHandler as xr, tableRowHandler as nr } from "./plugins/sanitize/rehype-table-align.js";
36
+ import { useSelectedSecurityOption as Oe } from "./api-playground-2/hooks/useSelectedSecurityOption.js";
37
+ import { addApiReferenceDataFromMdxAndDocsConfig as ze } from "./api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js";
38
+ import { processSecurityOptions as Be } from "./api-playground-2/schemaGraph/processSecurityOptions.js";
39
+ import { getApiReferenceDataFromGraph as qe } from "./api-playground-2/schemaGraph/getApiReferenceDataFromGraph.js";
40
+ import { ApiPage as Je } from "./components/apiPage.js";
41
+ import { CodeBlock as je } from "./components/content-components/code-block.js";
42
+ import { Heading as Qe } from "./components/content-components/heading.js";
43
+ import { Link as Ve } from "./components/content-components/link.js";
44
+ import { Callout as _e } from "./components/content-components/callouts.js";
45
+ import { ZonePivot as eo } from "./components/content-components/zone-pivots/zone-pivot.js";
46
+ import { ZoneTarget as ro } from "./components/content-components/zone-pivots/zone-target.js";
47
+ import { ZonePivotProvider as po } from "./components/content-components/zone-pivots/zone-pivot-context.js";
48
+ import { ZonePivotSelector as ao } from "./components/content-components/zone-pivots/zone-pivot-selector.js";
49
+ import { ParamName as no } from "./components/content-components/param-name.js";
50
+ import { Tabs as lo } from "./components/content-components/tabs/tabs.js";
51
+ import { Tab as so } from "./components/content-components/tabs/tab.js";
52
+ import { Details as go, Summary as Po } from "./components/content-components/details/details.js";
53
+ import { Table as uo, TableBody as yo, TableCaption as To, TableCell as bo, TableFooter as vo, TableHead as Ao, TableHeader as Ho, TableRow as ho } from "./components/content-components/table/index.js";
54
+ import { LaTeX as Ro } from "./components/content-components/latex.js";
55
+ import { allComponents as ko } from "./components/content-components/all-components.js";
56
+ import { Home as wo } from "./components/content-components/home.js";
57
+ import { MobileNavTree as Fo } from "./components/nav-tree/mobile-nav.js";
58
+ import { rehypeCodeblocks as No } from "./plugins/rehype/rehype-code-blocks.js";
59
+ import { remarkHeadingIds as Zo } from "./plugins/remark/remark-heading-ids.js";
60
+ import { sanitizePreTags as Eo } from "./plugins/sanitize/rehype-pre-to-mdx-fence.js";
61
+ import { rehypeCallouts as Xo } from "./plugins/sanitize/rehype-callouts.js";
62
+ import { rehypeParamName as Go } from "./plugins/sanitize/rehype-param-name.js";
63
+ import { rehypeTabs as Wo } from "./plugins/sanitize/rehype-tabs.js";
64
+ import { rehypeDetails as Ko } from "./plugins/sanitize/rehype-details.js";
65
+ import { rehypeHeadingIds as Uo } from "./plugins/sanitize/rehype-heading-ids.js";
66
+ import { rehypeZonePivots as Yo } from "./plugins/sanitize/rehype-zone-pivots.js";
67
+ import { mdxJsxFlowElementHandler as $o, rehypeRemark as er } from "./plugins/sanitize/rehype-remark.js";
68
+ import { rehypeLatex as rr } from "./plugins/sanitize/rehype-latex.js";
69
+ import { tableCellHandler as pr, tableHandler as mr, tableRowHandler as ar } from "./plugins/sanitize/rehype-table-align.js";
71
70
  export {
72
71
  ie as Api,
73
- ue as ApiExamples,
72
+ ce as ApiExamples,
74
73
  ye as ApiFields,
75
- qe as ApiPlayground,
74
+ Je as ApiPage,
76
75
  he as ApiPlaygroundContext,
77
- Je as ApiPlaygroundContextLegacy,
76
+ De as ApiPlaygroundContextLegacy,
78
77
  T as ApiReferenceContext,
79
78
  b as ApiReferenceContext2,
80
79
  v as ApiReferenceProvider,
81
80
  A as ApiReferenceProvider2,
82
- eo as Callout,
83
- Qe as CodeBlock,
84
- s as ComponentsProvider,
81
+ _e as Callout,
82
+ je as CodeBlock,
83
+ d as ComponentsProvider,
85
84
  H as DeploymentMetadataContext,
86
85
  h as DeploymentMetadataProvider,
87
- uo as Details,
86
+ go as Details,
88
87
  D as DocsConfigContext,
89
88
  R as DocsConfigProvider,
90
89
  p as DocsLayout,
91
90
  r as DocsPage,
92
- je as EndpointFields,
93
91
  Ae as EndpointHeader,
94
- Ve as Heading,
95
- Lo as Home,
96
- ko as LaTeX,
97
- _e as Link,
92
+ Qe as Heading,
93
+ wo as Home,
94
+ Ro as LaTeX,
95
+ Ve as Link,
98
96
  a as MDXRenderer,
99
- No as MobileNavTree,
97
+ Fo as MobileNavTree,
100
98
  P as NavTree,
101
- se as OperationPage,
99
+ de as OperationPage,
102
100
  M as PageContext,
103
101
  N as PageContextMenu,
104
102
  k as PageProvider,
105
- lo as ParamName,
106
- L as PivotAwareTOC,
103
+ no as ParamName,
104
+ F as PivotAwareTOC,
107
105
  n as PlainTextPage,
108
106
  be as Playground,
109
107
  ge as SchemaPage,
110
- co as Summary,
111
- go as Tab,
112
- To as Table,
113
- bo as TableBody,
114
- vo as TableCaption,
115
- Ao as TableCell,
116
- Ho as TableFooter,
117
- ho as TableHead,
118
- Do as TableHeader,
108
+ Po as Summary,
109
+ so as Tab,
110
+ uo as Table,
111
+ yo as TableBody,
112
+ To as TableCaption,
113
+ bo as TableCell,
114
+ vo as TableFooter,
115
+ Ao as TableHead,
116
+ Ho as TableHeader,
119
117
  w as TableOfContents,
120
- Ro as TableRow,
121
- so as Tabs,
122
- ro as ZonePivot,
123
- ao as ZonePivotProvider,
124
- no as ZonePivotSelector,
125
- po as ZoneTarget,
126
- Ee as addApiReferenceDataFromMdxAndDocsConfig,
127
- wo as allComponents,
118
+ ho as TableRow,
119
+ lo as Tabs,
120
+ eo as ZonePivot,
121
+ po as ZonePivotProvider,
122
+ ao as ZonePivotSelector,
123
+ ro as ZoneTarget,
124
+ ze as addApiReferenceDataFromMdxAndDocsConfig,
125
+ ko as allComponents,
128
126
  j as capitalize,
129
127
  V as cleanTitle,
130
128
  Q as cn,
131
129
  re as convertHtmlToMdx,
132
- O as copyMarkdownToClipboard,
130
+ Z as copyMarkdownToClipboard,
133
131
  l as createDefaultComponents,
134
132
  i as defaultComponents,
135
133
  ae as extractHeadings,
136
134
  X as generateLlmsFullTxt,
137
135
  q as generateLlmsTxt,
138
- Be as getApiReferenceDataFromGraph,
136
+ qe as getApiReferenceDataFromGraph,
139
137
  _ as getClassNames,
140
138
  J as getNodeText,
141
- Z as getPageMarkdown,
139
+ z as getPageMarkdown,
142
140
  $ as getTextContent,
143
141
  ee as isElement,
144
- or as mdxJsxFlowElementHandler,
145
- Ze as processSecurityOptions,
146
- Go as rehypeCallouts,
147
- Oo as rehypeCodeblocks,
148
- Uo as rehypeDetails,
149
- Yo as rehypeHeadingIds,
150
- pr as rehypeLatex,
151
- Wo as rehypeParamName,
152
- rr as rehypeRemark,
142
+ $o as mdxJsxFlowElementHandler,
143
+ Be as processSecurityOptions,
144
+ Xo as rehypeCallouts,
145
+ No as rehypeCodeblocks,
146
+ Ko as rehypeDetails,
147
+ Uo as rehypeHeadingIds,
148
+ rr as rehypeLatex,
149
+ Go as rehypeParamName,
150
+ er as rehypeRemark,
153
151
  ne as rehypeRemoveHtmlComments,
154
- Ko as rehypeTabs,
155
- $o as rehypeZonePivots,
156
- zo as remarkHeadingIds,
152
+ Wo as rehypeTabs,
153
+ Yo as rehypeZonePivots,
154
+ Zo as remarkHeadingIds,
157
155
  fe as removeHtmlComments,
158
- Xo as sanitizePreTags,
156
+ Eo as sanitizePreTags,
159
157
  pe as serializeMdx,
160
- ar as tableCellHandler,
161
- xr as tableHandler,
162
- nr as tableRowHandler,
163
- c as useApiReference,
158
+ pr as tableCellHandler,
159
+ mr as tableHandler,
160
+ ar as tableRowHandler,
161
+ u as useApiReference,
164
162
  C as useComponents,
165
163
  Ie as useCopyPathWithInputs,
166
- Fe as useInitializeInputs,
167
- z as useMarkdownCopy,
168
- Re as usePlaygroundInputsStore,
169
- Me as useSelectedSecurityOption,
164
+ Le as useInitializeInputs,
165
+ E as useMarkdownCopy,
166
+ Me as usePlaygroundInputsStore,
167
+ Oe as useSelectedSecurityOption,
170
168
  Se as useSendPlaygroundRequest
171
169
  };
@@ -1,33 +1,4 @@
1
- import { generateNextItems as c } from "./generateNextItems.js";
2
- import { getAuthFilteredSchemaArray as p } from "./getAuthFilteredSchemaArray.js";
3
- const g = 5, s = " | null", b = (t, a, $, l, o = 0) => {
4
- let u = !1;
5
- const r = $ ? s : "";
6
- switch (t.type) {
7
- case "any":
8
- return "any";
9
- case "null":
10
- return "null";
11
- case "object":
12
- return t.title ? `${t.title} · object` : "object";
13
- case "array":
14
- let i = c(t, a, void 0);
15
- const y = p({ schemaArray: i, userGroups: l });
16
- if (y && (i = y), i.some((n) => n.type === "array") && o >= g)
17
- return u = !0, `array${r}`;
18
- const f = /* @__PURE__ */ new Set();
19
- i.forEach(
20
- (n) => f.add(
21
- b(n, a, !1, l, o + 1)
22
- )
23
- );
24
- const e = Array.from(f);
25
- return u ? `array${r}` : e.length === 1 && e[0] === "object" && t.title ? `${t.title} · object[]${r}` : e.length === 1 ? `${e[0]}[]${r}` : e.length > 1 && t.title ? `${t.title} · array` : e.every((n) => n !== "object" && n !== "array") ? `(${e.join(" | ")})[]${r}` : `array${r}`;
26
- default:
27
- return `${"format" in t && typeof t.format == "string" ? `${t.type}<${t.format}>` : t.type}${r}`;
28
- }
29
- };
1
+ const l = " | null";
30
2
  export {
31
- b as generateTypeStringFromSchema,
32
- s as orNullTypeString
3
+ l as orNullTypeString
33
4
  };
@@ -1,23 +1,23 @@
1
- import { visit as l } from "unist-util-visit";
1
+ import { visit as n } from "unist-util-visit";
2
2
  import { isElement as t } from "../../utils/rehype.js";
3
- const c = () => (i) => {
4
- console.log("sanitizePreTags", JSON.stringify(i, null, 2)), l(i, (s) => {
5
- var n;
6
- if (!t(s) || !t(s, "tagName", "pre"))
3
+ const c = () => (p) => {
4
+ n(p, (a) => {
5
+ var o;
6
+ if (!t(a) || !t(a, "tagName", "pre"))
7
7
  return;
8
- const e = s.children[0];
8
+ const e = a.children[0];
9
9
  if (!e || !t(e, "tagName", "code"))
10
10
  return;
11
- const o = (n = e.properties) == null ? void 0 : n.className;
12
- if (Array.isArray(o)) {
13
- for (const r of o)
11
+ const i = (o = e.properties) == null ? void 0 : o.className;
12
+ if (Array.isArray(i)) {
13
+ for (const r of i)
14
14
  if (typeof r == "string" && r.startsWith("lang-")) {
15
- const a = r.replace(/^lang-/, "");
16
- e.properties || (e.properties = {}), e.properties.className = [`language-${a}`];
15
+ const s = r.replace(/^lang-/, "");
16
+ e.properties || (e.properties = {}), e.properties.className = [`language-${s}`];
17
17
  break;
18
18
  } else if (typeof r == "string" && r.startsWith("language-")) {
19
- const a = r.replace(/^language-/, "");
20
- e.properties || (e.properties = {}), e.properties.className = [`language-${a}`];
19
+ const s = r.replace(/^language-/, "");
20
+ e.properties || (e.properties = {}), e.properties.className = [`language-${s}`];
21
21
  break;
22
22
  }
23
23
  }