@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.
Files changed (124) hide show
  1. package/dist/{chunk-BN_g-Awi.js → chunk-BYypO7fO.js} +3 -3
  2. package/dist/components/MaskedInput.d.ts +3 -3
  3. package/dist/components/MaskedInput.js +1 -1
  4. package/dist/components/breadcrumbs.d.ts +24 -1
  5. package/dist/components/breadcrumbs.js +62 -7
  6. package/dist/components/icons.d.ts +18 -13
  7. package/dist/components/icons.js +940 -2
  8. package/dist/components/index.d.ts +16 -14
  9. package/dist/components/index.js +72 -18
  10. package/dist/components/method.d.ts +58 -1
  11. package/dist/components/method.js +95 -8
  12. package/dist/components/overview.d.ts +38 -1
  13. package/dist/components/overview.js +137 -9
  14. package/dist/components/primitives.d.ts +104 -1
  15. package/dist/components/primitives.js +250 -6
  16. package/dist/components/properties.d.ts +53 -1
  17. package/dist/components/properties.js +138 -7
  18. package/dist/components/sdk-sidebar.d.ts +14 -1
  19. package/dist/components/sdk-sidebar.js +50 -8
  20. package/dist/components/sdk.d.ts +121 -1
  21. package/dist/components/sdk.js +405 -8
  22. package/dist/components/snippets.d.ts +70 -13
  23. package/dist/components/snippets.js +182 -7
  24. package/dist/components/stl-sidebar.d.ts +57 -1
  25. package/dist/components/stl-sidebar.js +105 -3
  26. package/dist/contexts/component-generics.d.ts +29 -1
  27. package/dist/contexts/component-generics.js +31 -1
  28. package/dist/contexts/component-types.d.ts +4 -15
  29. package/dist/contexts/component.d.ts +7 -17
  30. package/dist/contexts/component.js +22 -28
  31. package/dist/contexts/docs.d.ts +61 -1
  32. package/dist/contexts/docs.js +89 -1
  33. package/dist/contexts/index.d.ts +13 -14
  34. package/dist/contexts/index.js +44 -6
  35. package/dist/contexts/markdown.d.ts +21 -1
  36. package/dist/contexts/markdown.js +47 -2
  37. package/dist/contexts/navigation.d.ts +28 -1
  38. package/dist/contexts/navigation.js +22 -1
  39. package/dist/contexts/use-components.d.ts +1 -13
  40. package/dist/contexts/use-components.js +6 -2
  41. package/dist/{index-HDt5wRiR.d.ts → index-Cl6Gny0o.d.ts} +37 -2
  42. package/dist/index.d.ts +4 -14
  43. package/dist/index.js +7 -30
  44. package/dist/languages/cli.d.ts +38 -14
  45. package/dist/languages/cli.js +166 -20
  46. package/dist/languages/csharp.d.ts +42 -14
  47. package/dist/languages/csharp.js +283 -8
  48. package/dist/languages/go.d.ts +40 -14
  49. package/dist/languages/go.js +303 -8
  50. package/dist/languages/http.d.ts +46 -14
  51. package/dist/languages/http.js +390 -19
  52. package/dist/languages/index.d.ts +51 -14
  53. package/dist/languages/index.js +32 -28
  54. package/dist/languages/java.d.ts +43 -14
  55. package/dist/languages/java.js +403 -8
  56. package/dist/languages/php.d.ts +40 -0
  57. package/dist/languages/php.js +313 -0
  58. package/dist/languages/python.d.ts +40 -14
  59. package/dist/languages/python.js +269 -8
  60. package/dist/languages/ruby.d.ts +40 -14
  61. package/dist/languages/ruby.js +387 -8
  62. package/dist/languages/terraform.d.ts +48 -14
  63. package/dist/languages/terraform.js +243 -8
  64. package/dist/languages/typescript.d.ts +40 -14
  65. package/dist/languages/typescript.js +449 -8
  66. package/dist/markdown/index.d.ts +1 -2
  67. package/dist/markdown/index.js +1 -28
  68. package/dist/markdown/printer.d.ts +2 -2
  69. package/dist/markdown/printer.js +6 -30
  70. package/dist/markdown/utils.d.ts +3 -3
  71. package/dist/routing.d.ts +61 -2
  72. package/dist/routing.js +205 -2
  73. package/dist/spec.d.ts +2 -2
  74. package/dist/spec.js +2 -2
  75. package/dist/style.js +176 -1
  76. package/dist/use-strict-context-L0c8JKg4.js +16 -0
  77. package/dist/utils.d.ts +1 -1
  78. package/dist/utils.js +53 -2
  79. package/package.json +3 -3
  80. package/dist/breadcrumbs-Dei_5sHd.d.ts +0 -25
  81. package/dist/breadcrumbs-oUp-6oJK.js +0 -63
  82. package/dist/cli-BX9ofVCR.js +0 -166
  83. package/dist/component-Dl5ZEHxB.js +0 -23
  84. package/dist/component-generics-C9ALAcZI.d.ts +0 -30
  85. package/dist/component-generics-POFirVVb.js +0 -45
  86. package/dist/components-DQPlXEwE.js +0 -72
  87. package/dist/contexts-_NNW5yqC.js +0 -44
  88. package/dist/csharp-sn5CJu9t.js +0 -283
  89. package/dist/docs-YgoQ3bzY.js +0 -81
  90. package/dist/docs-x-kfjRMc.d.ts +0 -66
  91. package/dist/go-BoaAVmP0.js +0 -303
  92. package/dist/http-Ccj1dOvE.js +0 -389
  93. package/dist/icons-BYKn5X8E.js +0 -885
  94. package/dist/index-OCM-LZIo.d.ts +0 -428
  95. package/dist/java-BiLRuLuD.js +0 -403
  96. package/dist/languages-COjc0Nwx.js +0 -30
  97. package/dist/markdown-BszOPZhh.d.ts +0 -22
  98. package/dist/markdown-Cq3XEhrR.js +0 -49
  99. package/dist/method-DjzVBzZe.js +0 -96
  100. package/dist/method-KkWyhvKa.d.ts +0 -59
  101. package/dist/navigation-BZjwfN2P.d.ts +0 -29
  102. package/dist/navigation-aoYZ_tl4.js +0 -24
  103. package/dist/overview-BNmMeDUE.d.ts +0 -39
  104. package/dist/overview-Clq5psZe.js +0 -138
  105. package/dist/primitives-B8OnSXRP.d.ts +0 -105
  106. package/dist/primitives-BBUs_flm.js +0 -250
  107. package/dist/properties-BhlRtWo4.d.ts +0 -54
  108. package/dist/properties-DQU0NBzb.js +0 -138
  109. package/dist/python-nqOBH7GS.js +0 -269
  110. package/dist/routing-GvhEMw6E.js +0 -205
  111. package/dist/routing-qJMPICGo.d.ts +0 -61
  112. package/dist/ruby-BBc8HdIt.js +0 -387
  113. package/dist/sdk-C8C6IRQp.d.ts +0 -122
  114. package/dist/sdk-DzCHhEoX.js +0 -405
  115. package/dist/sdk-sidebar-CkjSLggl.js +0 -50
  116. package/dist/sdk-sidebar-lgNmf-ns.d.ts +0 -15
  117. package/dist/snippets-CLpNVNlA.js +0 -181
  118. package/dist/stl-sidebar-8jF9cdnn.d.ts +0 -58
  119. package/dist/stl-sidebar-DC5UOJiT.js +0 -106
  120. package/dist/style-DJIYkFhO.js +0 -178
  121. package/dist/terraform-DVx2ea2h.js +0 -243
  122. package/dist/typescript-Cmk-jBBw.js +0 -449
  123. package/dist/use-components-BUz3GbO4.js +0 -7
  124. package/dist/utils-D6zJxUZ9.js +0 -54
@@ -1,3 +1,91 @@
1
- import { a as useDocs, c as useResource, d as useSnippetIds, f as useSnippetResponse, i as useDeclaration, l as useSettings, m as useSpec, n as useAvailableLanguages, o as useIgnoredResources, p as useSnippets, r as useContentPanelLayout, s as useLanguage, t as DocsProvider, u as useSnippet } from "../docs-YgoQ3bzY.js";
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 };
@@ -1,14 +1,13 @@
1
- import "../primitives-B8OnSXRP.js";
2
- import "../breadcrumbs-Dei_5sHd.js";
3
- import "../method-KkWyhvKa.js";
4
- import "../properties-BhlRtWo4.js";
5
- import "../sdk-C8C6IRQp.js";
6
- import { g as useLanguageComponents } from "../index-OCM-LZIo.js";
7
- import { a as useNavigation, i as NavigationProviderProps, n as NavigationHandler, r as NavigationProvider, t as NavigationContextType } from "../navigation-BZjwfN2P.js";
8
- import { a as useMarkdownContext, i as useHighlight, n as MarkdownProvider, o as useRenderMarkdown, r as MarkdownProviderProps, t as MarkdownContext } from "../markdown-BszOPZhh.js";
9
- import { a as useComponents, i as useComponentContext, n as ComponentsContextType, r as customizeComponents, t as ComponentProvider } from "../component-generics-C9ALAcZI.js";
10
- import { _ as useSnippetResponse, a as DocsProviderProps, c as useContentPanelLayout, d as useIgnoredResources, f as useLanguage, g as useSnippetIds, h as useSnippet, i as DocsProvider, l as useDeclaration, m as useSettings, n as Declaration, o as PropertySettingsType, p as useResource, r as DocsContextType, s as useAvailableLanguages, t as ContentPanelLayout, u as useDocs, v as useSnippets, y as useSpec } from "../docs-x-kfjRMc.js";
11
- import "../overview-BNmMeDUE.js";
12
- import "../sdk-sidebar-lgNmf-ns.js";
13
- import "../stl-sidebar-8jF9cdnn.js";
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 };
@@ -1,7 +1,45 @@
1
- import { a as useDocs, c as useResource, d as useSnippetIds, f as useSnippetResponse, i as useDeclaration, l as useSettings, m as useSpec, n as useAvailableLanguages, o as useIgnoredResources, p as useSnippets, r as useContentPanelLayout, s as useLanguage, t as DocsProvider, u as useSnippet } from "../docs-YgoQ3bzY.js";
2
- import { i as useComponents, n as customizeComponents, r as useComponentContext, t as ComponentProvider } from "../component-generics-POFirVVb.js";
3
- import { n as useNavigation, t as NavigationProvider } from "../navigation-aoYZ_tl4.js";
4
- import { a as useRenderMarkdown, i as useMarkdownContext, n as MarkdownProvider, r as useHighlight, t as MarkdownContext } from "../markdown-Cq3XEhrR.js";
5
- import { n as useLanguageComponents } from "../contexts-_NNW5yqC.js";
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
- export { ComponentProvider, DocsProvider, MarkdownContext, MarkdownProvider, NavigationProvider, customizeComponents, useAvailableLanguages, useComponentContext, useComponents, useContentPanelLayout, useDeclaration, useDocs, useHighlight, useIgnoredResources, useLanguage, useLanguageComponents, useMarkdownContext, useNavigation, useRenderMarkdown, useResource, useSettings, useSnippet, useSnippetIds, useSnippetResponse, useSnippets, useSpec };
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 { a as useMarkdownContext, i as useHighlight, n as MarkdownProvider, o as useRenderMarkdown, r as MarkdownProviderProps, t as MarkdownContext } from "../markdown-BszOPZhh.js";
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 "../docs-YgoQ3bzY.js";
2
- import { a as useRenderMarkdown, i as useMarkdownContext, n as MarkdownProvider, r as useHighlight, t as MarkdownContext } from "../markdown-Cq3XEhrR.js";
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 { a as useNavigation, i as NavigationProviderProps, n as NavigationHandler, r as NavigationProvider, t as NavigationContextType } from "../navigation-BZjwfN2P.js";
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 { n as useNavigation, t as NavigationProvider } from "../navigation-aoYZ_tl4.js";
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 "../primitives-B8OnSXRP.js";
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 "../component-generics-POFirVVb.js";
2
- import { t as useComponents } from "../use-components-BUz3GbO4.js";
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 { Spec as _, GoAST as a, TerraformAST as b, ID as c, Method as d, Model as f, SnippetLanguage as g, RubyAST as h, DeclarationNode as i, JavaAST as l, Resource as m, CLIAST as n, HasStainlessPath as o, PythonAST as p, CSharpAST as r, HttpAST as s, BaseDeclaration as t, LanguageDeclNodes as u, SpecLanguage as v, Type as x, TSAST as y };
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 "./primitives-B8OnSXRP.js";
2
- import "./breadcrumbs-Dei_5sHd.js";
3
- import "./method-KkWyhvKa.js";
4
- import "./properties-BhlRtWo4.js";
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 "./docs-YgoQ3bzY.js";
2
- import "./component-generics-POFirVVb.js";
3
- import "./navigation-aoYZ_tl4.js";
4
- import "./markdown-Cq3XEhrR.js";
5
- import { t as contexts_exports } from "./contexts-_NNW5yqC.js";
6
- import "./use-components-BUz3GbO4.js";
7
- import { t as style_default } from "./style-DJIYkFhO.js";
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 };
@@ -1,14 +1,38 @@
1
- import "../primitives-B8OnSXRP.js";
2
- import "../breadcrumbs-Dei_5sHd.js";
3
- import "../method-KkWyhvKa.js";
4
- import "../properties-BhlRtWo4.js";
5
- import "../sdk-C8C6IRQp.js";
6
- import { B as Type, F as DeclarationProps, I as MethodSignature, L as MethodSignatureProps, P as Declaration, R as Property, V as TypeName, z as PropertyProps } 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";
14
- export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };
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 };