@stainless-api/docs-ui 0.1.0-beta.73 → 0.1.0-beta.75
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 +3 -3
- 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 +18 -13
- package/dist/components/icons.js +940 -2
- 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 +405 -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-HDt5wRiR.d.ts → index-Cl6Gny0o.d.ts} +37 -2
- 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 +51 -14
- package/dist/languages/index.js +32 -28
- package/dist/languages/java.d.ts +43 -14
- package/dist/languages/java.js +403 -8
- package/dist/languages/php.d.ts +40 -0
- package/dist/languages/php.js +313 -0
- 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 +205 -2
- package/dist/spec.d.ts +2 -2
- 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-Dei_5sHd.d.ts +0 -25
- package/dist/breadcrumbs-oUp-6oJK.js +0 -63
- package/dist/cli-BX9ofVCR.js +0 -166
- package/dist/component-Dl5ZEHxB.js +0 -23
- package/dist/component-generics-C9ALAcZI.d.ts +0 -30
- package/dist/component-generics-POFirVVb.js +0 -45
- package/dist/components-DQPlXEwE.js +0 -72
- package/dist/contexts-_NNW5yqC.js +0 -44
- package/dist/csharp-sn5CJu9t.js +0 -283
- package/dist/docs-YgoQ3bzY.js +0 -81
- package/dist/docs-x-kfjRMc.d.ts +0 -66
- package/dist/go-BoaAVmP0.js +0 -303
- package/dist/http-Ccj1dOvE.js +0 -389
- package/dist/icons-BYKn5X8E.js +0 -885
- package/dist/index-OCM-LZIo.d.ts +0 -428
- package/dist/java-BiLRuLuD.js +0 -403
- package/dist/languages-COjc0Nwx.js +0 -30
- package/dist/markdown-BszOPZhh.d.ts +0 -22
- package/dist/markdown-Cq3XEhrR.js +0 -49
- package/dist/method-DjzVBzZe.js +0 -96
- package/dist/method-KkWyhvKa.d.ts +0 -59
- package/dist/navigation-BZjwfN2P.d.ts +0 -29
- package/dist/navigation-aoYZ_tl4.js +0 -24
- package/dist/overview-BNmMeDUE.d.ts +0 -39
- package/dist/overview-Clq5psZe.js +0 -138
- package/dist/primitives-B8OnSXRP.d.ts +0 -105
- package/dist/primitives-BBUs_flm.js +0 -250
- package/dist/properties-BhlRtWo4.d.ts +0 -54
- package/dist/properties-DQU0NBzb.js +0 -138
- package/dist/python-nqOBH7GS.js +0 -269
- package/dist/routing-GvhEMw6E.js +0 -205
- package/dist/routing-qJMPICGo.d.ts +0 -61
- package/dist/ruby-BBc8HdIt.js +0 -387
- package/dist/sdk-C8C6IRQp.d.ts +0 -122
- package/dist/sdk-DzCHhEoX.js +0 -405
- package/dist/sdk-sidebar-CkjSLggl.js +0 -50
- package/dist/sdk-sidebar-lgNmf-ns.d.ts +0 -15
- package/dist/snippets-CLpNVNlA.js +0 -181
- package/dist/stl-sidebar-8jF9cdnn.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-D6zJxUZ9.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-Dei_5sHd.js";
|
|
3
|
-
import "../method-KkWyhvKa.js";
|
|
4
|
-
import "../properties-BhlRtWo4.js";
|
|
5
|
-
import "../sdk-C8C6IRQp.js";
|
|
6
|
-
import { t as index_d_exports } from "../index-OCM-LZIo.js";
|
|
7
|
-
import "../navigation-BZjwfN2P.js";
|
|
8
|
-
import "../markdown-BszOPZhh.js";
|
|
9
|
-
import "../component-generics-C9ALAcZI.js";
|
|
10
|
-
import "../docs-x-kfjRMc.js";
|
|
11
|
-
import "../overview-BNmMeDUE.js";
|
|
12
|
-
import "../sdk-sidebar-lgNmf-ns.js";
|
|
13
|
-
import "../stl-sidebar-8jF9cdnn.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 };
|
|
@@ -816,6 +816,12 @@ type PhpMethodParameter = {
|
|
|
816
816
|
optional: boolean;
|
|
817
817
|
hasDefault?: boolean;
|
|
818
818
|
};
|
|
819
|
+
type PhpMethodDeclParameter = BaseDeclaration & {
|
|
820
|
+
kind: 'PhpMethodDeclParameter';
|
|
821
|
+
ident: PhpIdentifier;
|
|
822
|
+
typeAnnotation: PhpType;
|
|
823
|
+
hasDefault?: boolean;
|
|
824
|
+
};
|
|
819
825
|
type PhpDeclReference = BaseDeclaration & {
|
|
820
826
|
kind: 'PhpDeclReference';
|
|
821
827
|
docstring?: string;
|
|
@@ -932,6 +938,35 @@ type PhpTypeComplexBuiltin = BaseType & {
|
|
|
932
938
|
kind: 'PhpTypeComplexBuiltin';
|
|
933
939
|
typeName: 'resource' | 'callable' | 'class-string' | 'array' | 'object';
|
|
934
940
|
};
|
|
941
|
+
type PhpAST_PhpDeclAssocArray = PhpDeclAssocArray;
|
|
942
|
+
type PhpAST_PhpDeclAssocArrayProperty = PhpDeclAssocArrayProperty;
|
|
943
|
+
type PhpAST_PhpDeclClass = PhpDeclClass;
|
|
944
|
+
type PhpAST_PhpDeclClassProperty = PhpDeclClassProperty;
|
|
945
|
+
type PhpAST_PhpDeclEnum = PhpDeclEnum;
|
|
946
|
+
type PhpAST_PhpDeclMethod = PhpDeclMethod;
|
|
947
|
+
type PhpAST_PhpDeclParam = PhpDeclParam;
|
|
948
|
+
type PhpAST_PhpDeclReference = PhpDeclReference;
|
|
949
|
+
type PhpAST_PhpDeclaration = PhpDeclaration;
|
|
950
|
+
type PhpAST_PhpMethodDeclParameter = PhpMethodDeclParameter;
|
|
951
|
+
type PhpAST_PhpMethodParameter = PhpMethodParameter;
|
|
952
|
+
type PhpAST_PhpType = PhpType;
|
|
953
|
+
type PhpAST_PhpTypeBool = PhpTypeBool;
|
|
954
|
+
type PhpAST_PhpTypeComplexBuiltin = PhpTypeComplexBuiltin;
|
|
955
|
+
type PhpAST_PhpTypeDatetime = PhpTypeDatetime;
|
|
956
|
+
type PhpAST_PhpTypeFloat = PhpTypeFloat;
|
|
957
|
+
type PhpAST_PhpTypeInt = PhpTypeInt;
|
|
958
|
+
type PhpAST_PhpTypeListArray<T extends Code = string> = PhpTypeListArray<T>;
|
|
959
|
+
type PhpAST_PhpTypeLiteral = PhpTypeLiteral;
|
|
960
|
+
type PhpAST_PhpTypeMapArray<T extends Code = string> = PhpTypeMapArray<T>;
|
|
961
|
+
type PhpAST_PhpTypeMixed = PhpTypeMixed;
|
|
962
|
+
type PhpAST_PhpTypeNull = PhpTypeNull;
|
|
963
|
+
type PhpAST_PhpTypeReference<T extends Code = string> = PhpTypeReference<T>;
|
|
964
|
+
type PhpAST_PhpTypeString = PhpTypeString;
|
|
965
|
+
type PhpAST_PhpTypeUnion<T extends Code = string> = PhpTypeUnion<T>;
|
|
966
|
+
type PhpAST_SDKJSONPhpType<T extends Code = string> = SDKJSONPhpType<T>;
|
|
967
|
+
declare namespace PhpAST {
|
|
968
|
+
export type { PhpAST_PhpDeclAssocArray as PhpDeclAssocArray, PhpAST_PhpDeclAssocArrayProperty as PhpDeclAssocArrayProperty, PhpAST_PhpDeclClass as PhpDeclClass, PhpAST_PhpDeclClassProperty as PhpDeclClassProperty, PhpAST_PhpDeclEnum as PhpDeclEnum, PhpAST_PhpDeclMethod as PhpDeclMethod, PhpAST_PhpDeclParam as PhpDeclParam, PhpAST_PhpDeclReference as PhpDeclReference, PhpAST_PhpDeclaration as PhpDeclaration, PhpAST_PhpMethodDeclParameter as PhpMethodDeclParameter, PhpAST_PhpMethodParameter as PhpMethodParameter, PhpAST_PhpType as PhpType, PhpAST_PhpTypeBool as PhpTypeBool, PhpAST_PhpTypeComplexBuiltin as PhpTypeComplexBuiltin, PhpAST_PhpTypeDatetime as PhpTypeDatetime, PhpAST_PhpTypeFloat as PhpTypeFloat, PhpAST_PhpTypeInt as PhpTypeInt, PhpAST_PhpTypeListArray as PhpTypeListArray, PhpAST_PhpTypeLiteral as PhpTypeLiteral, PhpAST_PhpTypeMapArray as PhpTypeMapArray, PhpAST_PhpTypeMixed as PhpTypeMixed, PhpAST_PhpTypeNull as PhpTypeNull, PhpAST_PhpTypeReference as PhpTypeReference, PhpAST_PhpTypeString as PhpTypeString, PhpAST_PhpTypeUnion as PhpTypeUnion, PhpAST_SDKJSONPhpType as SDKJSONPhpType };
|
|
969
|
+
}
|
|
935
970
|
type PythonDeclaration = PythonDeclFunction | PythonDeclClass | PythonDeclType | PythonDeclProperty | PythonDeclReference | ErrorDecl;
|
|
936
971
|
type PythonDeclFunction = BaseDeclaration & {
|
|
937
972
|
kind: 'PythonDeclFunction';
|
|
@@ -1468,7 +1503,7 @@ type SnippetLanguage<lang extends SpecLanguage = SpecLanguage> = (typeof Snippet
|
|
|
1468
1503
|
/**
|
|
1469
1504
|
* A literal property path from Spec down to a given node
|
|
1470
1505
|
*/
|
|
1471
|
-
type Type = HttpType | TSType | PythonType | GoType | RubyType | JavaType | CSharpType | AttributeType;
|
|
1506
|
+
type Type = HttpType | TSType | PythonType | GoType | RubyType | JavaType | CSharpType | PhpType | AttributeType;
|
|
1472
1507
|
type Spec = {
|
|
1473
1508
|
name: string;
|
|
1474
1509
|
kind: 'spec';
|
|
@@ -1734,4 +1769,4 @@ declare namespace GoAST {
|
|
|
1734
1769
|
export type { GoAST_GoDeclConst as GoDeclConst, GoAST_GoDeclFunction as GoDeclFunction, GoAST_GoDeclProperty as GoDeclProperty, GoAST_GoDeclReference as GoDeclReference, GoAST_GoDeclType as GoDeclType, GoAST_GoDeclTypeAlias as GoDeclTypeAlias, GoAST_GoDeclaration as GoDeclaration, GoAST_GoFunctionParameter as GoFunctionParameter, GoAST_GoGenericParameter as GoGenericParameter, GoAST_GoIdentifier as GoIdentifier, GoAST_GoType as GoType, GoAST_GoTypeAny as GoTypeAny, GoAST_GoTypeArray as GoTypeArray, GoAST_GoTypeBool as GoTypeBool, GoAST_GoTypeError as GoTypeError, GoAST_GoTypeFloat as GoTypeFloat, GoAST_GoTypeInt as GoTypeInt, GoAST_GoTypeInterface as GoTypeInterface, GoAST_GoTypeMap as GoTypeMap, GoAST_GoTypePointer as GoTypePointer, GoAST_GoTypeReference as GoTypeReference, GoAST_GoTypeString as GoTypeString, GoAST_GoTypeStruct as GoTypeStruct, GoAST_GoTypeUnknown as GoTypeUnknown };
|
|
1735
1770
|
}
|
|
1736
1771
|
//#endregion
|
|
1737
|
-
export {
|
|
1772
|
+
export { Type as S, SnippetLanguage as _, GoAST as a, TSAST as b, ID as c, Method as d, Model as f, RubyAST as g, Resource as h, DeclarationNode as i, JavaAST as l, PythonAST as m, CLIAST as n, HasStainlessPath as o, PhpAST as p, CSharpAST as r, HttpAST as s, BaseDeclaration as t, LanguageDeclNodes as u, Spec as v, TerraformAST as x, SpecLanguage as y };
|
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-qJMPICGo.js";
|
|
6
|
-
import "./sdk-C8C6IRQp.js";
|
|
7
|
-
import { h as index_d_exports$1, t as index_d_exports, y as index_d_exports$2 } from "./index-OCM-LZIo.js";
|
|
8
|
-
import "./navigation-BZjwfN2P.js";
|
|
9
|
-
import "./markdown-BszOPZhh.js";
|
|
10
|
-
import "./component-generics-C9ALAcZI.js";
|
|
11
|
-
import "./docs-x-kfjRMc.js";
|
|
12
|
-
import "./overview-BNmMeDUE.js";
|
|
13
|
-
import "./sdk-sidebar-lgNmf-ns.js";
|
|
14
|
-
import "./stl-sidebar-8jF9cdnn.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-GvhEMw6E.js";
|
|
11
|
-
import "./primitives-BBUs_flm.js";
|
|
12
|
-
import "./icons-BYKn5X8E.js";
|
|
13
|
-
import "./sdk-DzCHhEoX.js";
|
|
14
|
-
import "./snippets-CLpNVNlA.js";
|
|
15
|
-
import { a as utils_exports } from "./utils-D6zJxUZ9.js";
|
|
16
|
-
import "./overview-Clq5psZe.js";
|
|
17
|
-
import "./breadcrumbs-oUp-6oJK.js";
|
|
18
|
-
import "./stl-sidebar-DC5UOJiT.js";
|
|
19
|
-
import "./sdk-sidebar-CkjSLggl.js";
|
|
20
|
-
import { t as components_exports } from "./components-DQPlXEwE.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-Ccj1dOvE.js";
|
|
27
|
-
import "./csharp-sn5CJu9t.js";
|
|
28
|
-
import "./cli-BX9ofVCR.js";
|
|
29
|
-
import "./terraform-DVx2ea2h.js";
|
|
30
|
-
import { n as languages_exports } from "./languages-COjc0Nwx.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-Cl6Gny0o.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 };
|