@stainless-api/docs-ui 0.1.0-beta.72 → 0.1.0-beta.74
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/{chunk-BN_g-Awi.js → chunk-BYypO7fO.js} +3 -3
- package/dist/components/MaskedInput.d.ts +1 -1
- package/dist/components/MaskedInput.js +1 -1
- package/dist/components/breadcrumbs.d.ts +24 -1
- package/dist/components/breadcrumbs.js +62 -7
- package/dist/components/icons.d.ts +12 -12
- package/dist/components/icons.js +883 -1
- package/dist/components/index.d.ts +16 -14
- package/dist/components/index.js +72 -18
- package/dist/components/method.d.ts +58 -1
- package/dist/components/method.js +95 -8
- package/dist/components/overview.d.ts +38 -1
- package/dist/components/overview.js +137 -9
- package/dist/components/primitives.d.ts +104 -1
- package/dist/components/primitives.js +250 -6
- package/dist/components/properties.d.ts +53 -1
- package/dist/components/properties.js +138 -7
- package/dist/components/sdk-sidebar.d.ts +14 -1
- package/dist/components/sdk-sidebar.js +50 -8
- package/dist/components/sdk.d.ts +121 -1
- package/dist/components/sdk.js +404 -8
- package/dist/components/snippets.d.ts +70 -13
- package/dist/components/snippets.js +182 -7
- package/dist/components/stl-sidebar.d.ts +57 -1
- package/dist/components/stl-sidebar.js +105 -3
- package/dist/contexts/component-generics.d.ts +29 -1
- package/dist/contexts/component-generics.js +31 -1
- package/dist/contexts/component-types.d.ts +4 -15
- package/dist/contexts/component.d.ts +7 -17
- package/dist/contexts/component.js +22 -28
- package/dist/contexts/docs.d.ts +61 -1
- package/dist/contexts/docs.js +89 -1
- package/dist/contexts/index.d.ts +13 -14
- package/dist/contexts/index.js +44 -6
- package/dist/contexts/markdown.d.ts +21 -1
- package/dist/contexts/markdown.js +47 -2
- package/dist/contexts/navigation.d.ts +28 -1
- package/dist/contexts/navigation.js +22 -1
- package/dist/contexts/use-components.d.ts +1 -13
- package/dist/contexts/use-components.js +6 -2
- package/dist/{index-W4Td2Hl7.d.ts → index-PdnFhQF9.d.ts} +1 -1
- package/dist/index.d.ts +4 -14
- package/dist/index.js +7 -30
- package/dist/languages/cli.d.ts +38 -14
- package/dist/languages/cli.js +166 -20
- package/dist/languages/csharp.d.ts +42 -14
- package/dist/languages/csharp.js +283 -8
- package/dist/languages/go.d.ts +40 -14
- package/dist/languages/go.js +303 -8
- package/dist/languages/http.d.ts +46 -14
- package/dist/languages/http.js +390 -19
- package/dist/languages/index.d.ts +50 -14
- package/dist/languages/index.js +30 -28
- package/dist/languages/java.d.ts +43 -14
- package/dist/languages/java.js +403 -8
- package/dist/languages/python.d.ts +40 -14
- package/dist/languages/python.js +269 -8
- package/dist/languages/ruby.d.ts +40 -14
- package/dist/languages/ruby.js +387 -8
- package/dist/languages/terraform.d.ts +48 -14
- package/dist/languages/terraform.js +243 -8
- package/dist/languages/typescript.d.ts +40 -14
- package/dist/languages/typescript.js +449 -8
- package/dist/markdown/index.d.ts +1 -2
- package/dist/markdown/index.js +1 -28
- package/dist/markdown/printer.d.ts +2 -2
- package/dist/markdown/printer.js +6 -30
- package/dist/markdown/utils.d.ts +3 -3
- package/dist/routing.d.ts +61 -2
- package/dist/routing.js +204 -2
- package/dist/spec.d.ts +4 -4
- package/dist/spec.js +2 -2
- package/dist/style.js +176 -1
- package/dist/use-strict-context-L0c8JKg4.js +16 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +53 -2
- package/package.json +3 -3
- package/dist/breadcrumbs-46Qjx1Pd.d.ts +0 -25
- package/dist/breadcrumbs-BZ4wBC9-.d.ts +0 -25
- package/dist/breadcrumbs-BiBfNqBI.js +0 -63
- package/dist/cli-hduQ5XS1.js +0 -166
- package/dist/component-BU8BTbqz.js +0 -23
- package/dist/component-generics-Bw4ZOyEG.d.ts +0 -30
- package/dist/component-generics-D-WarFUb.d.ts +0 -30
- package/dist/component-generics-POFirVVb.js +0 -45
- package/dist/components-9NMl1791.js +0 -72
- package/dist/contexts-_NNW5yqC.js +0 -44
- package/dist/csharp-sn5CJu9t.js +0 -283
- package/dist/docs-Cu9Yl6-y.d.ts +0 -66
- package/dist/docs-YgoQ3bzY.js +0 -81
- package/dist/docs-xb5wYGjM.d.ts +0 -66
- package/dist/go-BoaAVmP0.js +0 -303
- package/dist/http-B3qTyMc3.js +0 -389
- package/dist/icons-BYKn5X8E.js +0 -885
- package/dist/index-BOmn7DHa.d.ts +0 -428
- package/dist/index-BvcPmB0r.d.ts +0 -428
- package/dist/java-BiLRuLuD.js +0 -403
- package/dist/languages-vUhD5Hu_.js +0 -30
- package/dist/markdown-BszOPZhh.d.ts +0 -22
- package/dist/markdown-Cq3XEhrR.js +0 -49
- package/dist/markdown-plMAoN22.d.ts +0 -22
- package/dist/method-C4PgTWAu.d.ts +0 -59
- package/dist/method-D6R_farj.d.ts +0 -59
- package/dist/method-DjzVBzZe.js +0 -96
- package/dist/navigation-HiZWRl34.d.ts +0 -29
- package/dist/navigation-MrP4Ubbg.d.ts +0 -29
- package/dist/navigation-aoYZ_tl4.js +0 -24
- package/dist/overview-CTeKhpQq.d.ts +0 -39
- package/dist/overview-Yf1PTJNi.d.ts +0 -39
- package/dist/overview-ocTARt-j.js +0 -138
- package/dist/primitives-CNG-fEhQ.js +0 -250
- package/dist/primitives-K7NijV36.d.ts +0 -105
- package/dist/primitives-WGxdBJDS.d.ts +0 -105
- package/dist/properties-Bu4nW9JD.d.ts +0 -54
- package/dist/properties-Bynmj9_H.d.ts +0 -54
- package/dist/properties-DQU0NBzb.js +0 -138
- package/dist/python-nqOBH7GS.js +0 -269
- package/dist/routing-C64k4fmX.js +0 -205
- package/dist/routing-pAL4V4hv.d.ts +0 -61
- package/dist/ruby-BBc8HdIt.js +0 -387
- package/dist/sdk-BSdgEEJw.js +0 -405
- package/dist/sdk-BVCk1ox2.d.ts +0 -122
- package/dist/sdk-Dm0S-XQE.d.ts +0 -122
- package/dist/sdk-sidebar-B1ehT_xI.d.ts +0 -15
- package/dist/sdk-sidebar-BDn8S1xS.js +0 -50
- package/dist/sdk-sidebar-Dqeu7C1-.d.ts +0 -15
- package/dist/snippets-CLpNVNlA.js +0 -181
- package/dist/stl-sidebar-BTTErIJs.d.ts +0 -58
- package/dist/stl-sidebar-C7GNALtk.d.ts +0 -58
- package/dist/stl-sidebar-DC5UOJiT.js +0 -106
- package/dist/style-DJIYkFhO.js +0 -178
- package/dist/terraform-DVx2ea2h.js +0 -243
- package/dist/typescript-Cmk-jBBw.js +0 -449
- package/dist/use-components-BUz3GbO4.js +0 -7
- package/dist/utils-DPbkW1Tz.js +0 -54
package/dist/contexts/docs.js
CHANGED
|
@@ -1,3 +1,91 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
|
|
4
|
+
//#region src/contexts/docs.tsx
|
|
5
|
+
const DocsContextDefaults = {
|
|
6
|
+
settings: {},
|
|
7
|
+
language: "node",
|
|
8
|
+
spec: null
|
|
9
|
+
};
|
|
10
|
+
const DocsContext = React$1.createContext(DocsContextDefaults);
|
|
11
|
+
function useDocs() {
|
|
12
|
+
return React$1.use(DocsContext);
|
|
13
|
+
}
|
|
14
|
+
function useSpec() {
|
|
15
|
+
return useDocs().spec;
|
|
16
|
+
}
|
|
17
|
+
function useSettings() {
|
|
18
|
+
return useDocs().settings;
|
|
19
|
+
}
|
|
20
|
+
function useSnippets(stainlessPath, language) {
|
|
21
|
+
const defaultLanguage = useLanguage();
|
|
22
|
+
const lang = language ?? defaultLanguage;
|
|
23
|
+
const snippetLanguage = lang === "http" ? "http.curl" : `${lang}.default`;
|
|
24
|
+
return useSpec()?.snippets?.[snippetLanguage]?.[stainlessPath];
|
|
25
|
+
}
|
|
26
|
+
function useSnippetIds(stainlessPath, language) {
|
|
27
|
+
const snippets = useSnippets(stainlessPath, language);
|
|
28
|
+
if (!snippets) return void 0;
|
|
29
|
+
return Object.keys(snippets).flatMap((key) => {
|
|
30
|
+
const customPrefix = "custom:";
|
|
31
|
+
if (key.startsWith(customPrefix)) return `${customPrefix}${key.slice(7)}`;
|
|
32
|
+
if (key === "default") return "default";
|
|
33
|
+
return [];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** Find a custom snippet named Default (case-insensitive); otherwise use the generated default */
|
|
37
|
+
function getDefaultSnippet(snippets) {
|
|
38
|
+
return Object.entries(snippets).find(([key]) => key.toLowerCase() === "custom:default")?.[1] ?? snippets.default;
|
|
39
|
+
}
|
|
40
|
+
function useSnippet(stainlessPath, language, snippetId) {
|
|
41
|
+
const snippets = useSnippets(stainlessPath, language);
|
|
42
|
+
if (!snippets) return void 0;
|
|
43
|
+
if (!snippetId) return getDefaultSnippet(snippets)?.content;
|
|
44
|
+
return snippets?.[snippetId]?.content;
|
|
45
|
+
}
|
|
46
|
+
function useSnippetResponse(stainlessPath, snippetId) {
|
|
47
|
+
const responses = useSpec()?.snippetResponses.http[stainlessPath];
|
|
48
|
+
if (!responses) return void 0;
|
|
49
|
+
if (!snippetId) return getDefaultSnippet(responses);
|
|
50
|
+
return responses[snippetId];
|
|
51
|
+
}
|
|
52
|
+
function useDeclaration(stainlessPath, required, language) {
|
|
53
|
+
const defaultLanguage = useLanguage();
|
|
54
|
+
const decl = useSpec()?.decls?.[language ?? defaultLanguage]?.[stainlessPath];
|
|
55
|
+
if (required && !decl) throw new Error(`Declaration not found for '${stainlessPath}'`);
|
|
56
|
+
return decl;
|
|
57
|
+
}
|
|
58
|
+
function useAvailableLanguages(stainlessPath) {
|
|
59
|
+
const spec = useSpec();
|
|
60
|
+
return Object.keys(spec?.decls ?? {}).filter((lang) => spec?.decls?.[lang]?.[stainlessPath] !== void 0);
|
|
61
|
+
}
|
|
62
|
+
function useIgnoredResources() {
|
|
63
|
+
return ["(resource) webhooks > (model) unwrap_webhook_event > (schema)"];
|
|
64
|
+
}
|
|
65
|
+
function useResource(name) {
|
|
66
|
+
return useSpec()?.resources?.[name];
|
|
67
|
+
}
|
|
68
|
+
function useLanguage() {
|
|
69
|
+
return useDocs().language;
|
|
70
|
+
}
|
|
71
|
+
function useContentPanelLayout() {
|
|
72
|
+
return useDocs().settings?.contentPanelLayout ?? "double-pane";
|
|
73
|
+
}
|
|
74
|
+
function DocsProvider({ spec, language, settings, children }) {
|
|
75
|
+
return /* @__PURE__ */ jsx(DocsContext, {
|
|
76
|
+
value: React$1.useMemo(() => ({
|
|
77
|
+
...DocsContextDefaults,
|
|
78
|
+
spec,
|
|
79
|
+
settings: settings ?? DocsContextDefaults.settings,
|
|
80
|
+
language: language ?? DocsContextDefaults.language
|
|
81
|
+
}), [
|
|
82
|
+
spec,
|
|
83
|
+
language,
|
|
84
|
+
settings
|
|
85
|
+
]),
|
|
86
|
+
children
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
3
91
|
export { DocsProvider, useAvailableLanguages, useContentPanelLayout, useDeclaration, useDocs, useIgnoredResources, useLanguage, useResource, useSettings, useSnippet, useSnippetIds, useSnippetResponse, useSnippets, useSpec };
|
package/dist/contexts/index.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export { ComponentProvider, ComponentsContextType, ContentPanelLayout, Declaration, DocsContextType, DocsProvider, DocsProviderProps, MarkdownContext, MarkdownProvider, MarkdownProviderProps, NavigationContextType, NavigationHandler, NavigationProvider, NavigationProviderProps, PropertySettingsType, customizeComponents, useAvailableLanguages, useComponentContext, useComponents, useContentPanelLayout, useDeclaration, useDocs, useHighlight, useIgnoredResources, useLanguage, useLanguageComponents, useMarkdownContext, useNavigation, useRenderMarkdown, useResource, useSettings, useSnippet, useSnippetIds, useSnippetResponse, useSnippets, useSpec };
|
|
1
|
+
import { LanguageComponentDefinition } from "../languages/index.js";
|
|
2
|
+
import { NavigationContextType, NavigationHandler, NavigationProvider, NavigationProviderProps, useNavigation } from "./navigation.js";
|
|
3
|
+
import { MarkdownContext, MarkdownProvider, MarkdownProviderProps, useHighlight, useMarkdownContext, useRenderMarkdown } from "./markdown.js";
|
|
4
|
+
import { ComponentProvider, ComponentsContextType, customizeComponents, useComponentContext, useComponents } from "./component-generics.js";
|
|
5
|
+
import { ContentPanelLayout, Declaration, DocsContextType, DocsProvider, DocsProviderProps, PropertySettingsType, useAvailableLanguages, useContentPanelLayout, useDeclaration, useDocs, useIgnoredResources, useLanguage, useResource, useSettings, useSnippet, useSnippetIds, useSnippetResponse, useSnippets, useSpec } from "./docs.js";
|
|
6
|
+
|
|
7
|
+
//#region src/contexts/index.d.ts
|
|
8
|
+
declare namespace index_d_exports {
|
|
9
|
+
export { ComponentProvider, ComponentsContextType, ContentPanelLayout, Declaration, DocsContextType, DocsProvider, DocsProviderProps, MarkdownContext, MarkdownProvider, MarkdownProviderProps, NavigationContextType, NavigationHandler, NavigationProvider, NavigationProviderProps, PropertySettingsType, customizeComponents, useAvailableLanguages, useComponentContext, useComponents, useContentPanelLayout, useDeclaration, useDocs, useHighlight, useIgnoredResources, useLanguage, useLanguageComponents, useMarkdownContext, useNavigation, useRenderMarkdown, useResource, useSettings, useSnippet, useSnippetIds, useSnippetResponse, useSnippets, useSpec };
|
|
10
|
+
}
|
|
11
|
+
declare function useLanguageComponents(): LanguageComponentDefinition;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ComponentProvider, ComponentsContextType, ContentPanelLayout, Declaration, DocsContextType, DocsProvider, DocsProviderProps, MarkdownContext, MarkdownProvider, MarkdownProviderProps, NavigationContextType, NavigationHandler, NavigationProvider, NavigationProviderProps, PropertySettingsType, customizeComponents, index_d_exports as t, useAvailableLanguages, useComponentContext, useComponents, useContentPanelLayout, useDeclaration, useDocs, useHighlight, useIgnoredResources, useLanguage, useLanguageComponents, useMarkdownContext, useNavigation, useRenderMarkdown, useResource, useSettings, useSnippet, useSnippetIds, useSnippetResponse, useSnippets, useSpec };
|
package/dist/contexts/index.js
CHANGED
|
@@ -1,7 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
+
import { DocsProvider, useAvailableLanguages, useContentPanelLayout, useDeclaration, useDocs, useIgnoredResources, useLanguage, useResource, useSettings, useSnippet, useSnippetIds, useSnippetResponse, useSnippets, useSpec } from "./docs.js";
|
|
3
|
+
import "../use-strict-context-L0c8JKg4.js";
|
|
4
|
+
import { ComponentProvider, customizeComponents, useComponentContext, useComponents } from "./component-generics.js";
|
|
5
|
+
import { NavigationProvider, useNavigation } from "./navigation.js";
|
|
6
|
+
import { MarkdownContext, MarkdownProvider, useHighlight, useMarkdownContext, useRenderMarkdown } from "./markdown.js";
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
//#region src/contexts/index.tsx
|
|
9
|
+
var contexts_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
ComponentProvider: () => ComponentProvider,
|
|
11
|
+
DocsProvider: () => DocsProvider,
|
|
12
|
+
MarkdownContext: () => MarkdownContext,
|
|
13
|
+
MarkdownProvider: () => MarkdownProvider,
|
|
14
|
+
NavigationProvider: () => NavigationProvider,
|
|
15
|
+
customizeComponents: () => customizeComponents,
|
|
16
|
+
useAvailableLanguages: () => useAvailableLanguages,
|
|
17
|
+
useComponentContext: () => useComponentContext,
|
|
18
|
+
useComponents: () => useComponents,
|
|
19
|
+
useContentPanelLayout: () => useContentPanelLayout,
|
|
20
|
+
useDeclaration: () => useDeclaration,
|
|
21
|
+
useDocs: () => useDocs,
|
|
22
|
+
useHighlight: () => useHighlight,
|
|
23
|
+
useIgnoredResources: () => useIgnoredResources,
|
|
24
|
+
useLanguage: () => useLanguage,
|
|
25
|
+
useLanguageComponents: () => useLanguageComponents,
|
|
26
|
+
useMarkdownContext: () => useMarkdownContext,
|
|
27
|
+
useNavigation: () => useNavigation,
|
|
28
|
+
useRenderMarkdown: () => useRenderMarkdown,
|
|
29
|
+
useResource: () => useResource,
|
|
30
|
+
useSettings: () => useSettings,
|
|
31
|
+
useSnippet: () => useSnippet,
|
|
32
|
+
useSnippetIds: () => useSnippetIds,
|
|
33
|
+
useSnippetResponse: () => useSnippetResponse,
|
|
34
|
+
useSnippets: () => useSnippets,
|
|
35
|
+
useSpec: () => useSpec
|
|
36
|
+
});
|
|
37
|
+
function useLanguageComponents() {
|
|
38
|
+
const language = useLanguage();
|
|
39
|
+
const definition = useComponentContext().language[language];
|
|
40
|
+
if (!definition) throw new Error(`Language component definition not found for language: ${language}`);
|
|
41
|
+
return definition;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { ComponentProvider, DocsProvider, MarkdownContext, MarkdownProvider, NavigationProvider, customizeComponents, contexts_exports as t, useAvailableLanguages, useComponentContext, useComponents, useContentPanelLayout, useDeclaration, useDocs, useHighlight, useIgnoredResources, useLanguage, useLanguageComponents, useMarkdownContext, useNavigation, useRenderMarkdown, useResource, useSettings, useSnippet, useSnippetIds, useSnippetResponse, useSnippets, useSpec };
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/contexts/markdown.d.ts
|
|
5
|
+
type MarkdownContext = {
|
|
6
|
+
highlight: (content: string, language: string) => string | Promise<string>;
|
|
7
|
+
render: (content: string) => string | Promise<string>;
|
|
8
|
+
};
|
|
9
|
+
declare const MarkdownContext: React$1.Context<MarkdownContext>;
|
|
10
|
+
declare const useMarkdownContext: () => MarkdownContext;
|
|
11
|
+
declare function useRenderMarkdown(content?: string): string | undefined;
|
|
12
|
+
declare function useHighlight(content: string, language?: string): string;
|
|
13
|
+
type MarkdownProviderProps = MarkdownContext & {
|
|
14
|
+
children: React$1.ReactNode;
|
|
15
|
+
};
|
|
16
|
+
declare function MarkdownProvider({
|
|
17
|
+
render,
|
|
18
|
+
highlight,
|
|
19
|
+
children
|
|
20
|
+
}: MarkdownProviderProps): react_jsx_runtime0.JSX.Element;
|
|
21
|
+
//#endregion
|
|
2
22
|
export { MarkdownContext, MarkdownProvider, MarkdownProviderProps, useHighlight, useMarkdownContext, useRenderMarkdown };
|
|
@@ -1,4 +1,49 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import
|
|
1
|
+
import { useLanguage } from "./docs.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
|
|
5
|
+
//#region src/contexts/markdown.tsx
|
|
6
|
+
const HighlightLanguageMappings = {
|
|
7
|
+
node: "typescript",
|
|
8
|
+
http: "bash",
|
|
9
|
+
cli: "bash"
|
|
10
|
+
};
|
|
11
|
+
const MarkdownContext = React$1.createContext({
|
|
12
|
+
highlight: (content) => content,
|
|
13
|
+
render: (content) => content
|
|
14
|
+
});
|
|
15
|
+
const useMarkdownContext = () => React$1.useContext(MarkdownContext);
|
|
16
|
+
function useRenderMarkdown(content) {
|
|
17
|
+
const { render } = React$1.useContext(MarkdownContext);
|
|
18
|
+
return React$1.useMemo(() => {
|
|
19
|
+
if (!content) return void 0;
|
|
20
|
+
const rendered = render(content);
|
|
21
|
+
return typeof rendered === "string" ? rendered : React$1.use(rendered);
|
|
22
|
+
}, [content, render]);
|
|
23
|
+
}
|
|
24
|
+
function useHighlight(content, language) {
|
|
25
|
+
const { highlight } = React$1.useContext(MarkdownContext);
|
|
26
|
+
const defaultLanguage = useLanguage();
|
|
27
|
+
const lang = language ?? defaultLanguage;
|
|
28
|
+
return React$1.useMemo(() => {
|
|
29
|
+
if (lang === "none") return content;
|
|
30
|
+
const rendered = highlight(content, HighlightLanguageMappings[lang] ?? lang);
|
|
31
|
+
return typeof rendered === "string" ? rendered : React$1.use(rendered);
|
|
32
|
+
}, [
|
|
33
|
+
content,
|
|
34
|
+
highlight,
|
|
35
|
+
lang
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
function MarkdownProvider({ render, highlight, children }) {
|
|
39
|
+
return /* @__PURE__ */ jsx(MarkdownContext.Provider, {
|
|
40
|
+
value: {
|
|
41
|
+
render,
|
|
42
|
+
highlight
|
|
43
|
+
},
|
|
44
|
+
children
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
4
49
|
export { MarkdownContext, MarkdownProvider, useHighlight, useMarkdownContext, useRenderMarkdown };
|
|
@@ -1,2 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DocsLanguage } from "../routing.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/contexts/navigation.d.ts
|
|
6
|
+
type NavigationHandler = (ev: React$1.MouseEvent | null, opts: {
|
|
7
|
+
href: string;
|
|
8
|
+
language: DocsLanguage;
|
|
9
|
+
stainlessPath: string;
|
|
10
|
+
scroll: boolean;
|
|
11
|
+
}) => void;
|
|
12
|
+
type NavigationContextType = {
|
|
13
|
+
basePath?: string;
|
|
14
|
+
selectedPath?: string;
|
|
15
|
+
navigationPath?: string[];
|
|
16
|
+
onNavigate?: NavigationHandler;
|
|
17
|
+
};
|
|
18
|
+
declare function useNavigation(): NavigationContextType;
|
|
19
|
+
type NavigationProviderProps = NavigationContextType & {
|
|
20
|
+
children: React$1.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
declare function NavigationProvider({
|
|
23
|
+
basePath,
|
|
24
|
+
selectedPath,
|
|
25
|
+
onNavigate,
|
|
26
|
+
children
|
|
27
|
+
}: NavigationProviderProps): react_jsx_runtime0.JSX.Element;
|
|
28
|
+
//#endregion
|
|
2
29
|
export { NavigationContextType, NavigationHandler, NavigationProvider, NavigationProviderProps, useNavigation };
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
|
|
4
|
+
//#region src/contexts/navigation.tsx
|
|
5
|
+
const Defaults = { basePath: "/" };
|
|
6
|
+
const NavigationContext = React$1.createContext(Defaults);
|
|
7
|
+
function useNavigation() {
|
|
8
|
+
return React$1.useContext(NavigationContext);
|
|
9
|
+
}
|
|
10
|
+
function NavigationProvider({ basePath, selectedPath, onNavigate, children }) {
|
|
11
|
+
const value = {
|
|
12
|
+
...Defaults,
|
|
13
|
+
onNavigate,
|
|
14
|
+
basePath,
|
|
15
|
+
selectedPath
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ jsx(NavigationContext.Provider, {
|
|
18
|
+
value,
|
|
19
|
+
children
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
3
24
|
export { NavigationProvider, useNavigation };
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../breadcrumbs-46Qjx1Pd.js";
|
|
3
|
-
import "../method-D6R_farj.js";
|
|
4
|
-
import "../properties-Bu4nW9JD.js";
|
|
5
|
-
import "../sdk-Dm0S-XQE.js";
|
|
6
|
-
import { t as index_d_exports } from "../index-BOmn7DHa.js";
|
|
7
|
-
import "../navigation-HiZWRl34.js";
|
|
8
|
-
import "../markdown-plMAoN22.js";
|
|
9
|
-
import "../component-generics-Bw4ZOyEG.js";
|
|
10
|
-
import "../docs-xb5wYGjM.js";
|
|
11
|
-
import "../overview-CTeKhpQq.js";
|
|
12
|
-
import "../sdk-sidebar-Dqeu7C1-.js";
|
|
13
|
-
import "../stl-sidebar-BTTErIJs.js";
|
|
1
|
+
import { t as index_d_exports } from "../components/index.js";
|
|
14
2
|
|
|
15
3
|
//#region src/contexts/use-components.d.ts
|
|
16
4
|
declare const useComponents: () => typeof index_d_exports;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import {
|
|
1
|
+
import "../use-strict-context-L0c8JKg4.js";
|
|
2
|
+
import { useComponents as useComponents$1 } from "./component-generics.js";
|
|
3
3
|
|
|
4
|
+
//#region src/contexts/use-components.tsx
|
|
5
|
+
const useComponents = () => useComponents$1();
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
4
8
|
export { useComponents };
|
|
@@ -152,7 +152,7 @@ interface Config {
|
|
|
152
152
|
} | undefined;
|
|
153
153
|
} | undefined;
|
|
154
154
|
description?: string | undefined;
|
|
155
|
-
languages?:
|
|
155
|
+
languages?: SupportedLanguage[] | undefined;
|
|
156
156
|
snippets?: {
|
|
157
157
|
exclude_languages?: string[] | undefined;
|
|
158
158
|
} | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import { v as routing_d_exports } from "./routing-pAL4V4hv.js";
|
|
6
|
-
import "./sdk-Dm0S-XQE.js";
|
|
7
|
-
import { h as index_d_exports$1, t as index_d_exports, y as index_d_exports$2 } from "./index-BOmn7DHa.js";
|
|
8
|
-
import "./navigation-HiZWRl34.js";
|
|
9
|
-
import "./markdown-plMAoN22.js";
|
|
10
|
-
import "./component-generics-Bw4ZOyEG.js";
|
|
11
|
-
import "./docs-xb5wYGjM.js";
|
|
12
|
-
import "./overview-CTeKhpQq.js";
|
|
13
|
-
import "./sdk-sidebar-Dqeu7C1-.js";
|
|
14
|
-
import "./stl-sidebar-BTTErIJs.js";
|
|
1
|
+
import { t as routing_d_exports } from "./routing.js";
|
|
2
|
+
import { t as index_d_exports$2 } from "./languages/index.js";
|
|
3
|
+
import { t as index_d_exports$1 } from "./contexts/index.js";
|
|
4
|
+
import { t as index_d_exports } from "./components/index.js";
|
|
15
5
|
import { t as utils_d_exports } from "./utils.js";
|
|
16
6
|
import _default from "./style.js";
|
|
17
7
|
export { index_d_exports as components, index_d_exports$1 as contexts, index_d_exports$2 as languages, routing_d_exports as routing, _default as style, utils_d_exports as utils };
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import { t as
|
|
6
|
-
import "./
|
|
7
|
-
import { t as
|
|
8
|
-
import "./properties-DQU0NBzb.js";
|
|
9
|
-
import "./method-DjzVBzZe.js";
|
|
10
|
-
import { m as routing_exports } from "./routing-C64k4fmX.js";
|
|
11
|
-
import "./primitives-CNG-fEhQ.js";
|
|
12
|
-
import "./icons-BYKn5X8E.js";
|
|
13
|
-
import "./sdk-BSdgEEJw.js";
|
|
14
|
-
import "./snippets-CLpNVNlA.js";
|
|
15
|
-
import { a as utils_exports } from "./utils-DPbkW1Tz.js";
|
|
16
|
-
import "./overview-ocTARt-j.js";
|
|
17
|
-
import "./breadcrumbs-BiBfNqBI.js";
|
|
18
|
-
import "./stl-sidebar-DC5UOJiT.js";
|
|
19
|
-
import "./sdk-sidebar-BDn8S1xS.js";
|
|
20
|
-
import { t as components_exports } from "./components-9NMl1791.js";
|
|
21
|
-
import "./typescript-Cmk-jBBw.js";
|
|
22
|
-
import "./java-BiLRuLuD.js";
|
|
23
|
-
import "./go-BoaAVmP0.js";
|
|
24
|
-
import "./python-nqOBH7GS.js";
|
|
25
|
-
import "./ruby-BBc8HdIt.js";
|
|
26
|
-
import "./http-B3qTyMc3.js";
|
|
27
|
-
import "./csharp-sn5CJu9t.js";
|
|
28
|
-
import "./cli-hduQ5XS1.js";
|
|
29
|
-
import "./terraform-DVx2ea2h.js";
|
|
30
|
-
import { n as languages_exports } from "./languages-vUhD5Hu_.js";
|
|
1
|
+
import "./use-strict-context-L0c8JKg4.js";
|
|
2
|
+
import { t as contexts_exports } from "./contexts/index.js";
|
|
3
|
+
import style_default from "./style.js";
|
|
4
|
+
import { t as routing_exports } from "./routing.js";
|
|
5
|
+
import { t as utils_exports } from "./utils.js";
|
|
6
|
+
import { t as components_exports } from "./components/index.js";
|
|
7
|
+
import { t as languages_exports } from "./languages/index.js";
|
|
31
8
|
|
|
32
9
|
export { components_exports as components, contexts_exports as contexts, languages_exports as languages, routing_exports as routing, style_default as style, utils_exports as utils };
|
package/dist/languages/cli.d.ts
CHANGED
|
@@ -1,14 +1,38 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { n as CLIAST, s as HttpAST } from "../index-PdnFhQF9.js";
|
|
2
|
+
import { PropertyFn } from "./index.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/languages/cli.d.ts
|
|
7
|
+
declare namespace cli_d_exports {
|
|
8
|
+
export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };
|
|
9
|
+
}
|
|
10
|
+
type TypeProps = {
|
|
11
|
+
type: HttpAST.HttpType;
|
|
12
|
+
};
|
|
13
|
+
declare function TypeName(props: TypeProps): string | react_jsx_runtime0.JSX.Element;
|
|
14
|
+
declare function Type({
|
|
15
|
+
type
|
|
16
|
+
}: TypeProps): react_jsx_runtime0.JSX.Element;
|
|
17
|
+
type MethodSignatureProps = {
|
|
18
|
+
decl: CLIAST.CLICommand;
|
|
19
|
+
};
|
|
20
|
+
declare function MethodSignature({
|
|
21
|
+
decl
|
|
22
|
+
}: MethodSignatureProps): react_jsx_runtime0.JSX.Element;
|
|
23
|
+
type PropertyProps = {
|
|
24
|
+
decl: CLIAST.CLIDeclaration;
|
|
25
|
+
children: PropertyFn;
|
|
26
|
+
};
|
|
27
|
+
declare function Property({
|
|
28
|
+
decl,
|
|
29
|
+
children
|
|
30
|
+
}: PropertyProps): React.ReactNode;
|
|
31
|
+
type DeclarationProps = {
|
|
32
|
+
decl: CLIAST.CLIDeclaration;
|
|
33
|
+
};
|
|
34
|
+
declare function Declaration({
|
|
35
|
+
decl
|
|
36
|
+
}: DeclarationProps): react_jsx_runtime0.JSX.Element | undefined;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName, cli_d_exports as t };
|