@mintlify/msft-sdk 1.1.24 → 1.1.25
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/PlaygroundModal.js +46 -45
- package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/index.js +18 -18
- package/dist/api-playground/ApiPlayground/Request/index.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js +20 -21
- package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js +10 -11
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js.map +1 -1
- package/dist/api-playground/ApiPlayground/index.js +30 -30
- package/dist/api-playground/ApiPlayground/index.js.map +1 -1
- package/dist/api-playground-2/constants/index.js +12 -3
- package/dist/api-playground-2/constants/index.js.map +1 -1
- package/dist/api-playground-2/schemaGraph/addUniqueKeysToSchema.js +41 -0
- package/dist/api-playground-2/schemaGraph/addUniqueKeysToSchema.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/errors.js +19 -0
- package/dist/api-playground-2/schemaGraph/errors.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/getApiReferenceDataFromGraph.js +26 -0
- package/dist/api-playground-2/schemaGraph/getApiReferenceDataFromGraph.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/getDocumentProperties.js +58 -0
- package/dist/api-playground-2/schemaGraph/getDocumentProperties.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/getSchemaGraphOperationData.js +77 -0
- package/dist/api-playground-2/schemaGraph/getSchemaGraphOperationData.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/getSchemaGraphSchemaData.js +16 -0
- package/dist/api-playground-2/schemaGraph/getSchemaGraphSchemaData.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/processExamples.js +111 -34
- package/dist/api-playground-2/schemaGraph/processExamples.js.map +1 -1
- package/dist/api-playground-2/schemaGraph/reduceCompositions.js +283 -0
- package/dist/api-playground-2/schemaGraph/reduceCompositions.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/resolveGraphNode.js +61 -0
- package/dist/api-playground-2/schemaGraph/resolveGraphNode.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/resolveOperationWithDependencies.js +149 -0
- package/dist/api-playground-2/schemaGraph/resolveOperationWithDependencies.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/resolveSchemaWithDependencies.js +33 -0
- package/dist/api-playground-2/schemaGraph/resolveSchemaWithDependencies.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/sortSchemaByRequired.js +35 -0
- package/dist/api-playground-2/schemaGraph/sortSchemaByRequired.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/utils.js +144 -98
- package/dist/api-playground-2/schemaGraph/utils.js.map +1 -1
- package/dist/common/parseApiTargetFromMetadata.js +24 -0
- package/dist/common/parseApiTargetFromMetadata.js.map +1 -0
- package/dist/common/parseOpenApiString.js +42 -0
- package/dist/common/parseOpenApiString.js.map +1 -0
- package/dist/components/Api/ApiReferenceProvider.js +6 -15
- package/dist/components/Api/ApiReferenceProvider.js.map +1 -1
- package/dist/components/nav-tree/index.js +135 -109
- package/dist/components/nav-tree/index.js.map +1 -1
- package/dist/contexts/ConfigContext.js +61 -12
- package/dist/contexts/ConfigContext.js.map +1 -1
- package/dist/contexts/MDXContentContext.js +0 -1
- package/dist/contexts/MDXContentContext.js.map +1 -1
- package/dist/index.d.ts +125 -9
- package/dist/index.js +156 -144
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/hooks/useCurrentPath.js +0 -17
- package/dist/hooks/useCurrentPath.js.map +0 -1
- package/dist/utils/decodeSlug.js +0 -8
- package/dist/utils/decodeSlug.js.map +0 -1
- package/dist/utils/optionallyAddLeadingSlash.js +0 -7
- package/dist/utils/optionallyAddLeadingSlash.js.map +0 -1
|
@@ -1,17 +1,66 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as o } from "react";
|
|
3
|
+
import { addApiReferenceDataFromMdxAndDocsConfig as P } from "../api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js";
|
|
4
|
+
import { processSecurityOptions as u } from "../api-playground-2/schemaGraph/processSecurityOptions.js";
|
|
5
|
+
const a = o({ pageMetadata: {} }), c = o({}), p = o({}), s = o({ apiReferenceData: {} }), C = o({
|
|
4
6
|
apiReferenceData2: {}
|
|
5
7
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
a.displayName = "PageContext";
|
|
9
|
+
c.displayName = "DeploymentMetadataContext";
|
|
10
|
+
p.displayName = "DocsConfigContext";
|
|
11
|
+
s.displayName = "ApiReferenceContext";
|
|
12
|
+
function l({ value: e, children: t }) {
|
|
13
|
+
return /* @__PURE__ */ n(a.Provider, { value: e, children: t });
|
|
14
|
+
}
|
|
15
|
+
function A({
|
|
16
|
+
value: e,
|
|
17
|
+
children: t
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ n(c.Provider, { value: e, children: t });
|
|
20
|
+
}
|
|
21
|
+
function M({
|
|
22
|
+
value: e,
|
|
23
|
+
children: t
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ n(p.Provider, { value: e, children: t });
|
|
26
|
+
}
|
|
27
|
+
function N({
|
|
28
|
+
value: e,
|
|
29
|
+
children: t
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ n(s.Provider, { value: e, children: t });
|
|
32
|
+
}
|
|
33
|
+
function O({
|
|
34
|
+
pageMetadata: e,
|
|
35
|
+
docsConfig: t,
|
|
36
|
+
mdxExtracts: d,
|
|
37
|
+
apiReferenceData2: f,
|
|
38
|
+
children: m
|
|
39
|
+
}) {
|
|
40
|
+
const r = P({
|
|
41
|
+
apiReferenceData2: f,
|
|
42
|
+
mdxExtracts: d,
|
|
43
|
+
docsConfig: t,
|
|
44
|
+
pageMetadata: e
|
|
45
|
+
}), i = u(r);
|
|
46
|
+
i.length > 0 && (r.dependencies || (r.dependencies = {
|
|
47
|
+
servers: {},
|
|
48
|
+
security: {},
|
|
49
|
+
processedSecurityOptions: []
|
|
50
|
+
}), r.dependencies.processedSecurityOptions = i);
|
|
51
|
+
const D = r;
|
|
52
|
+
return /* @__PURE__ */ n(C.Provider, { value: { apiReferenceData2: D ?? {} }, children: m });
|
|
53
|
+
}
|
|
10
54
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
55
|
+
s as ApiReferenceContext,
|
|
56
|
+
C as ApiReferenceContext2,
|
|
57
|
+
N as ApiReferenceProvider,
|
|
58
|
+
O as ApiReferenceProvider2,
|
|
59
|
+
c as DeploymentMetadataContext,
|
|
60
|
+
A as DeploymentMetadataProvider,
|
|
61
|
+
p as DocsConfigContext,
|
|
62
|
+
M as DocsConfigProvider,
|
|
63
|
+
a as PageContext,
|
|
64
|
+
l as PageProvider
|
|
16
65
|
};
|
|
17
66
|
//# sourceMappingURL=ConfigContext.js.map
|
|
@@ -1 +1 @@
|
|
|
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}:
|
|
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 pathname?: string;\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 type ApiReferenceProvider2Props = {\n pageMetadata: PageMetaTags;\n docsConfig: DocsConfig | undefined;\n mdxExtracts: MdxExtracts | undefined;\n apiReferenceData2: ApiReferenceDataV2 | undefined;\n children: ReactNode;\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}: ApiReferenceProvider2Props) {\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","PageProvider","value","children","jsx","DeploymentMetadataProvider","DocsConfigProvider","ApiReferenceProvider","ApiReferenceProvider2","pageMetadata","docsConfig","mdxExtracts","apiReferenceData2","apiReferenceDataWithMdxAndDocsConfig","addApiReferenceDataFromMdxAndDocsConfig","processedSecurityOptions","processSecurityOptions","filteredApiReferenceData"],"mappings":";;;;AAmEO,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;AAE3B,SAASE,EAAa,EAAE,OAAAC,GAAO,UAAAC,KAA6D;AACjG,SAAO,gBAAAC,EAACT,EAAY,UAAZ,EAAqB,OAAAO,GAAe,UAAAC,EAAA,CAAS;AACvD;AAEO,SAASE,EAA2B;AAAA,EACzC,OAAAH;AAAA,EACA,UAAAC;AACF,GAGG;AACD,SACE,gBAAAC,EAACP,EAA0B,UAA1B,EAAmC,OAAAK,GACjC,UAAAC,EAAA,CACH;AAEJ;AAEO,SAASG,EAAmB;AAAA,EACjC,OAAAJ;AAAA,EACA,UAAAC;AACF,GAGG;AACD,SAAO,gBAAAC,EAACN,EAAkB,UAAlB,EAA2B,OAAAI,GAAe,UAAAC,EAAA,CAAS;AAC7D;AAEO,SAASI,EAAqB;AAAA,EACnC,OAAAL;AAAA,EACA,UAAAC;AACF,GAGG;AACD,SAAO,gBAAAC,EAACL,EAAoB,UAApB,EAA6B,OAAAG,GAAe,UAAAC,EAAA,CAAS;AAC/D;AAEO,SAASK,EAAsB;AAAA,EACpC,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAT;AACF,GAA+B;AAK7B,QAAMU,IAAuCC,EAAwC;AAAA,IACnF,mBAHoCF;AAAA,IAIpC,aAAAD;AAAA,IACA,YAAAD;AAAA,IACA,cAAAD;AAAA,EAAA,CACD,GAGKM,IAA2BC,EAAuBH,CAAoC;AAC5F,EAAIE,EAAyB,SAAS,MAC/BF,EAAqC,iBACxCA,EAAqC,eAAe;AAAA,IAClD,SAAS,CAAA;AAAA,IACT,UAAU,CAAA;AAAA,IACV,0BAA0B,CAAA;AAAA,EAAC,IAG/BA,EAAqC,aAAa,2BAChDE;AAGJ,QAAME,IAA2BJ;AACjC,SACE,gBAAAT,EAACJ,EAAqB,UAArB,EAA8B,OAAO,EAAE,mBAAmBiB,KAA4B,CAAA,KACpF,UAAAd,GACH;AAEJ;"}
|
|
@@ -1 +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":"
|
|
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/index.d.ts
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
import { ApiPlaygroundDisplayType } from '@mintlify/models';
|
|
2
2
|
import { ApiPlaygroundInputs } from '@mintlify/validation';
|
|
3
3
|
import { ApiPlaygroundResultType } from '@mintlify/models';
|
|
4
|
+
import { AsyncAPIDocumentInterface } from '@mintlify/common';
|
|
5
|
+
import { ChannelData } from '@mintlify/common';
|
|
4
6
|
import { ClassValue } from 'clsx';
|
|
5
7
|
import { CodeSample } from '@mintlify/validation';
|
|
6
8
|
import { Context } from 'react';
|
|
9
|
+
import { DecoratedNavigationConfig } from '@mintlify/validation';
|
|
7
10
|
import { default as default_2 } from 'react';
|
|
11
|
+
import { DeploymentEntitlements } from '@mintlify/validation';
|
|
12
|
+
import { DeploymentFeedbackType } from '@mintlify/validation';
|
|
13
|
+
import { DeploymentPreviewType } from '@mintlify/validation';
|
|
8
14
|
import { DocsConfig } from '@mintlify/validation';
|
|
9
15
|
import { Element as Element_2 } from 'hast';
|
|
10
16
|
import { Endpoint } from '@mintlify/validation';
|
|
17
|
+
import { GitSource } from '@mintlify/validation';
|
|
11
18
|
import { Handle } from 'hast-util-to-mdast';
|
|
19
|
+
import { IncrementalDataSchemaArray } from '@mintlify/validation';
|
|
20
|
+
import { InkeepType } from '@mintlify/models';
|
|
12
21
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
13
22
|
import { MdxExtracts as MdxExtracts_2 } from '@mintlify/common';
|
|
14
23
|
import { MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
|
|
24
|
+
import { MintConfig } from '@mintlify/models';
|
|
15
25
|
import { Node as Node_2 } from 'unist';
|
|
16
26
|
import { Node as Node_3 } from 'hast';
|
|
27
|
+
import { OpenApiMetadata } from '@mintlify/models';
|
|
17
28
|
import { OpenAPIV3 } from 'openapi-types';
|
|
18
29
|
import { OpenAPIV3_1 } from 'openapi-types';
|
|
19
30
|
import { Operation } from '@mintlify/validation';
|
|
20
31
|
import { PageMetaTags } from '@mintlify/models';
|
|
32
|
+
import { PageType } from '@mintlify/models';
|
|
21
33
|
import { ParameterObject } from '@mintlify/validation';
|
|
22
34
|
import { Plugin as Plugin_2 } from 'unified';
|
|
23
35
|
import * as React_2 from 'react';
|
|
@@ -26,12 +38,15 @@ import { RequestBodyObject } from '@mintlify/validation';
|
|
|
26
38
|
import { ResponseObject } from '@mintlify/validation';
|
|
27
39
|
import { Root } from 'mdast';
|
|
28
40
|
import { Root as Root_2 } from 'hast';
|
|
41
|
+
import { SchemaGraphData } from '@mintlify/validation';
|
|
29
42
|
import { SchemaObject } from '@mintlify/validation';
|
|
30
43
|
import { SecurityOption } from '@mintlify/validation';
|
|
44
|
+
import { SerializeSuccess } from '@mintlify/mdx/types';
|
|
31
45
|
import { ServerObject } from '@mintlify/validation';
|
|
32
46
|
import { State } from 'hast-util-to-mdast';
|
|
33
47
|
import { StoreApi } from 'zustand';
|
|
34
48
|
import { Text as Text_2 } from 'hast';
|
|
49
|
+
import { TrieveType } from '@mintlify/validation';
|
|
35
50
|
import { UseBoundStore } from 'zustand';
|
|
36
51
|
import { UUID } from '@mintlify/validation';
|
|
37
52
|
|
|
@@ -56,6 +71,15 @@ export declare const allComponents: {
|
|
|
56
71
|
Summary: typeof Summary;
|
|
57
72
|
};
|
|
58
73
|
|
|
74
|
+
export declare interface AnchorConfig {
|
|
75
|
+
href: string;
|
|
76
|
+
title: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
icon?: default_2.ComponentType<{
|
|
79
|
+
className?: string;
|
|
80
|
+
}>;
|
|
81
|
+
}
|
|
82
|
+
|
|
59
83
|
export declare const Api: ({ children }: {
|
|
60
84
|
children: ReactNode;
|
|
61
85
|
}) => JSX_2.Element | null;
|
|
@@ -73,7 +97,7 @@ export declare function ApiFields({ pageMetadata }: {
|
|
|
73
97
|
pageMetadata: PageMetaTags;
|
|
74
98
|
}): JSX_2.Element;
|
|
75
99
|
|
|
76
|
-
export declare const ApiPlayground: ({ endpoint, display }: ApiPlaygroundParams) => JSX_2.Element;
|
|
100
|
+
export declare const ApiPlayground: ({ endpoint, display, pathname }: ApiPlaygroundParams) => JSX_2.Element;
|
|
77
101
|
|
|
78
102
|
export declare const ApiPlaygroundContext: Context<ApiPlaygroundContextType>;
|
|
79
103
|
|
|
@@ -108,6 +132,19 @@ export declare type ApiPlaygroundContextTypeLegacy = {
|
|
|
108
132
|
declare type ApiPlaygroundParams = {
|
|
109
133
|
endpoint: Endpoint;
|
|
110
134
|
display: ApiPlaygroundDisplayType;
|
|
135
|
+
pathname: string;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export declare const ApiReferenceContext: Context<ApiReferenceContextType>;
|
|
139
|
+
|
|
140
|
+
export declare const ApiReferenceContext2: Context<ApiReferenceContext2Type>;
|
|
141
|
+
|
|
142
|
+
export declare type ApiReferenceContext2Type = {
|
|
143
|
+
apiReferenceData2: ApiReferenceDataV2;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export declare type ApiReferenceContextType = {
|
|
147
|
+
apiReferenceData: ApiReferenceData;
|
|
111
148
|
};
|
|
112
149
|
|
|
113
150
|
declare interface ApiReferenceContextValue {
|
|
@@ -116,6 +153,16 @@ declare interface ApiReferenceContextValue {
|
|
|
116
153
|
mdxExtracts?: any;
|
|
117
154
|
}
|
|
118
155
|
|
|
156
|
+
declare type ApiReferenceData = {
|
|
157
|
+
metadata?: OpenApiMetadata;
|
|
158
|
+
endpoint?: Endpoint;
|
|
159
|
+
schemaData?: SchemaData;
|
|
160
|
+
componentSchemas?: ComponentSchemas;
|
|
161
|
+
channel?: ChannelData;
|
|
162
|
+
channelId?: string;
|
|
163
|
+
document?: AsyncAPIDocumentInterface;
|
|
164
|
+
};
|
|
165
|
+
|
|
119
166
|
export declare interface ApiReferenceDataV2 {
|
|
120
167
|
filename?: string;
|
|
121
168
|
originalFileLocation?: string;
|
|
@@ -132,14 +179,20 @@ export declare interface ApiReferenceDataV2 {
|
|
|
132
179
|
};
|
|
133
180
|
}
|
|
134
181
|
|
|
135
|
-
export declare function
|
|
182
|
+
export declare function ApiReferenceProvider({ value, children, }: {
|
|
183
|
+
value: ApiReferenceContextType;
|
|
184
|
+
children: ReactNode;
|
|
185
|
+
}): JSX_2.Element;
|
|
136
186
|
|
|
137
|
-
declare
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
187
|
+
export declare function ApiReferenceProvider2({ pageMetadata, docsConfig, mdxExtracts, apiReferenceData2, children, }: ApiReferenceProvider2Props): JSX_2.Element;
|
|
188
|
+
|
|
189
|
+
export declare type ApiReferenceProvider2Props = {
|
|
190
|
+
pageMetadata: PageMetaTags;
|
|
191
|
+
docsConfig: DocsConfig | undefined;
|
|
192
|
+
mdxExtracts: MdxExtracts_2 | undefined;
|
|
193
|
+
apiReferenceData2: ApiReferenceDataV2 | undefined;
|
|
194
|
+
children: ReactNode;
|
|
195
|
+
};
|
|
143
196
|
|
|
144
197
|
export declare interface BottomLinkConfig {
|
|
145
198
|
href: string;
|
|
@@ -186,6 +239,8 @@ export declare type CodeExample = {
|
|
|
186
239
|
filename?: string;
|
|
187
240
|
};
|
|
188
241
|
|
|
242
|
+
declare type ComponentSchemas = Record<string, OpenAPIV3_1.SchemaObject>;
|
|
243
|
+
|
|
189
244
|
declare interface ComponentsContextValue {
|
|
190
245
|
LinkComponent?: LinkComponent;
|
|
191
246
|
}
|
|
@@ -232,6 +287,26 @@ export declare interface CreateDefaultComponentsOptions {
|
|
|
232
287
|
|
|
233
288
|
export declare const defaultComponents: MDXComponents;
|
|
234
289
|
|
|
290
|
+
export declare const DeploymentMetadataContext: Context<DeploymentMetadataContextType>;
|
|
291
|
+
|
|
292
|
+
export declare type DeploymentMetadataContextType = {
|
|
293
|
+
subdomain?: string;
|
|
294
|
+
actualSubdomain?: string;
|
|
295
|
+
gitSource?: GitSource;
|
|
296
|
+
inkeep?: InkeepType;
|
|
297
|
+
trieve?: TrieveType;
|
|
298
|
+
feedback?: DeploymentFeedbackType;
|
|
299
|
+
entitlements?: DeploymentEntitlements;
|
|
300
|
+
buildId?: string;
|
|
301
|
+
clientVersion?: string;
|
|
302
|
+
preview?: DeploymentPreviewType;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
export declare function DeploymentMetadataProvider({ value, children, }: {
|
|
306
|
+
value: DeploymentMetadataContextType;
|
|
307
|
+
children: ReactNode;
|
|
308
|
+
}): JSX_2.Element;
|
|
309
|
+
|
|
235
310
|
export declare function Details({ children, open }: DetailsProps): JSX_2.Element;
|
|
236
311
|
|
|
237
312
|
declare interface DetailsProps {
|
|
@@ -241,6 +316,19 @@ declare interface DetailsProps {
|
|
|
241
316
|
|
|
242
317
|
export declare type DifferentiatedType = SchemaObject['type'] | 'oneOf' | 'any' | 'enum<string>' | 'enum<number>' | 'enum<integer>' | 'file';
|
|
243
318
|
|
|
319
|
+
export declare const DocsConfigContext: Context<DocsConfigContextType>;
|
|
320
|
+
|
|
321
|
+
export declare type DocsConfigContextType = {
|
|
322
|
+
mintConfig?: MintConfig;
|
|
323
|
+
docsConfig?: DocsConfig;
|
|
324
|
+
docsNavWithMetadata?: DecoratedNavigationConfig;
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
export declare function DocsConfigProvider({ value, children, }: {
|
|
328
|
+
value: DocsConfigContextType;
|
|
329
|
+
children: ReactNode;
|
|
330
|
+
}): JSX_2.Element;
|
|
331
|
+
|
|
244
332
|
/**
|
|
245
333
|
* DocsLayout component provides a complete documentation layout with sidebar navigation
|
|
246
334
|
* and main content area. It's designed to be scalable, customizable, and tree-shakable.
|
|
@@ -434,6 +522,11 @@ export declare function generateLlmsFullTxt(pages: LlmsPageConfig[], baseUrl: st
|
|
|
434
522
|
|
|
435
523
|
export declare function generateLlmsTxt(pages: LlmsPageConfig[], baseUrl: string): string;
|
|
436
524
|
|
|
525
|
+
export declare const getApiReferenceDataFromGraph: ({ metadata, schemaGraphData, }: {
|
|
526
|
+
metadata: PageMetaTags;
|
|
527
|
+
schemaGraphData: SchemaGraphData;
|
|
528
|
+
}) => ApiReferenceDataV2;
|
|
529
|
+
|
|
437
530
|
export declare function getClassNames(element: Element_2): string[];
|
|
438
531
|
|
|
439
532
|
export declare const getNodeText: (node: unknown) => string;
|
|
@@ -563,7 +656,7 @@ export declare interface NavItem {
|
|
|
563
656
|
method?: string;
|
|
564
657
|
}
|
|
565
658
|
|
|
566
|
-
export declare function NavTree({ navTree, activeId, className, activeHref, theme, bottomLinks, }: NavTreeProps): JSX_2.Element | null;
|
|
659
|
+
export declare function NavTree({ navTree, activeId, className, activeHref, theme, bottomLinks, anchors, }: NavTreeProps): JSX_2.Element | null;
|
|
567
660
|
|
|
568
661
|
export declare interface NavTreeData {
|
|
569
662
|
items: NavItem[];
|
|
@@ -576,6 +669,7 @@ declare interface NavTreeProps {
|
|
|
576
669
|
activeHref?: string;
|
|
577
670
|
theme?: "light" | "dark" | "system";
|
|
578
671
|
bottomLinks?: BottomLinkConfig[];
|
|
672
|
+
anchors?: AnchorConfig[];
|
|
579
673
|
}
|
|
580
674
|
|
|
581
675
|
export declare const OperationPage: ({ apiReferenceData, operation, children, }: {
|
|
@@ -603,6 +697,8 @@ export declare type OperationV2 = Operation & {
|
|
|
603
697
|
disableProxy?: boolean;
|
|
604
698
|
};
|
|
605
699
|
|
|
700
|
+
export declare const PageContext: Context<PageContextType>;
|
|
701
|
+
|
|
606
702
|
export declare const PageContextMenu: ({ className, pathname, markdownContent, onCopyMarkdown, onViewMarkdown, allPages, baseUrl, }: PageContextMenuProps) => JSX_2.Element;
|
|
607
703
|
|
|
608
704
|
/**
|
|
@@ -633,6 +729,21 @@ export declare interface PageContextMenuProps {
|
|
|
633
729
|
baseUrl?: string;
|
|
634
730
|
}
|
|
635
731
|
|
|
732
|
+
export declare type PageContextType = {
|
|
733
|
+
pageMetadata: PageMetaTags;
|
|
734
|
+
pageType?: PageType;
|
|
735
|
+
mdxExtracts?: MdxExtracts_2;
|
|
736
|
+
description?: SerializeSuccess | string | null;
|
|
737
|
+
panelMdxSource?: SerializeSuccess;
|
|
738
|
+
panelMdxSourceWithNoJs?: SerializeSuccess;
|
|
739
|
+
pathname?: string;
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
export declare function PageProvider({ value, children }: {
|
|
743
|
+
value: PageContextType;
|
|
744
|
+
children: ReactNode;
|
|
745
|
+
}): JSX_2.Element;
|
|
746
|
+
|
|
636
747
|
export declare function ParamName({ children }: ParamNameProps): JSX_2.Element;
|
|
637
748
|
|
|
638
749
|
declare interface ParamNameProps {
|
|
@@ -746,6 +857,11 @@ export declare type ResolvedSecurityObject = {
|
|
|
746
857
|
|
|
747
858
|
export declare const sanitizePreTags: Plugin_2<[], Node_3>;
|
|
748
859
|
|
|
860
|
+
declare type SchemaData = {
|
|
861
|
+
schemaArray: IncrementalDataSchemaArray;
|
|
862
|
+
example: unknown;
|
|
863
|
+
};
|
|
864
|
+
|
|
749
865
|
export declare type SchemaGeneratedExample = {
|
|
750
866
|
title: string;
|
|
751
867
|
description?: string;
|