@stainless-api/docs-ui 0.1.0-beta.8 → 0.1.0-beta.81
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-BYypO7fO.js +18 -0
- package/dist/components/MaskedInput.d.ts +14 -0
- package/dist/components/MaskedInput.js +76 -0
- package/dist/components/breadcrumbs.d.ts +25 -0
- package/dist/components/breadcrumbs.js +64 -0
- package/dist/components/icons.d.ts +65 -0
- package/dist/components/icons.js +941 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.js +75 -0
- package/dist/components/method.d.ts +59 -0
- package/dist/components/method.js +97 -0
- package/dist/components/overview.d.ts +39 -0
- package/dist/components/overview.js +139 -0
- package/dist/components/primitives.d.ts +107 -0
- package/dist/components/primitives.js +253 -0
- package/dist/components/properties.d.ts +54 -0
- package/dist/components/properties.js +146 -0
- package/dist/components/sdk-sidebar.d.ts +15 -0
- package/dist/components/sdk-sidebar.js +52 -0
- package/dist/components/sdk.d.ts +128 -0
- package/dist/components/sdk.js +490 -0
- package/dist/components/snippets.d.ts +71 -0
- package/dist/components/snippets.js +184 -0
- package/dist/components/stl-sidebar.d.ts +58 -0
- package/dist/components/stl-sidebar.js +114 -0
- package/dist/contexts/component-generics.d.ts +30 -0
- package/dist/contexts/component-generics.js +33 -0
- package/dist/contexts/component-types.d.ts +8 -0
- package/dist/contexts/component-types.js +0 -0
- package/dist/contexts/component.d.ts +21 -0
- package/dist/contexts/component.js +24 -0
- package/dist/contexts/docs.d.ts +62 -0
- package/dist/contexts/docs.js +91 -0
- package/dist/contexts/index.d.ts +13 -0
- package/dist/contexts/index.js +45 -0
- package/dist/contexts/markdown.d.ts +22 -0
- package/dist/contexts/markdown.js +49 -0
- package/dist/contexts/navigation.d.ts +29 -0
- package/dist/contexts/navigation.js +24 -0
- package/dist/contexts/use-components.d.ts +6 -0
- package/dist/contexts/use-components.js +8 -0
- package/dist/index-pvh-w1xa.d.ts +1776 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +9 -7542
- package/dist/languages/cli.d.ts +38 -0
- package/dist/languages/cli.js +167 -0
- package/dist/languages/csharp.d.ts +42 -0
- package/dist/languages/csharp.js +284 -0
- package/dist/languages/go.d.ts +40 -0
- package/dist/languages/go.js +304 -0
- package/dist/languages/http.d.ts +46 -0
- package/dist/languages/http.js +387 -0
- package/dist/languages/index.d.ts +51 -0
- package/dist/languages/index.js +33 -0
- package/dist/languages/java.d.ts +43 -0
- package/dist/languages/java.js +404 -0
- package/dist/languages/php.d.ts +40 -0
- package/dist/languages/php.js +313 -0
- package/dist/languages/python.d.ts +40 -0
- package/dist/languages/python.js +270 -0
- package/dist/languages/ruby.d.ts +40 -0
- package/dist/languages/ruby.js +388 -0
- package/dist/languages/terraform.d.ts +48 -0
- package/dist/languages/terraform.js +244 -0
- package/dist/languages/typescript.d.ts +40 -0
- package/dist/languages/typescript.js +450 -0
- package/dist/markdown/index.d.ts +11 -0
- package/dist/markdown/index.js +80 -0
- package/dist/markdown/md.d.ts +15 -0
- package/dist/markdown/md.js +41 -0
- package/dist/markdown/printer.d.ts +13 -0
- package/dist/markdown/printer.js +76 -0
- package/dist/markdown/utils.d.ts +21 -0
- package/dist/markdown/utils.js +31 -0
- package/dist/routing.d.ts +61 -0
- package/dist/routing.js +176 -150
- package/dist/spec.d.ts +65 -0
- package/dist/spec.js +167 -0
- package/dist/style.d.ts +178 -0
- package/dist/style.js +179 -0
- package/dist/styles/main.css +784 -752
- package/dist/styles/main.js +0 -0
- package/dist/styles/primitives.css +408 -446
- package/dist/styles/primitives.js +0 -0
- package/dist/styles/resets.css +32 -41
- package/dist/styles/resets.js +0 -0
- package/dist/styles/search.css +192 -270
- package/dist/styles/search.js +0 -0
- package/dist/styles/sidebar.css +182 -69
- package/dist/styles/sidebar.js +0 -0
- package/dist/styles/variables.css +28 -89
- package/dist/styles/variables.js +0 -0
- package/dist/styles.css +3423 -0
- package/dist/styles.mjs +1 -0
- package/dist/use-strict-context-L0c8JKg4.js +16 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.js +54 -0
- package/package.json +74 -22
- package/dist/mcp.js +0 -16003
- package/dist/styles/snippets.css +0 -132
- package/src/components/breadcrumbs.tsx +0 -94
- package/src/components/chat.tsx +0 -154
- package/src/components/dropdown.tsx +0 -91
- package/src/components/icons.tsx +0 -584
- package/src/components/index.ts +0 -9
- package/src/components/method.tsx +0 -146
- package/src/components/overview.tsx +0 -160
- package/src/components/primitives.tsx +0 -284
- package/src/components/properties.tsx +0 -130
- package/src/components/scripts/dropdown.ts +0 -78
- package/src/components/sdk.tsx +0 -403
- package/src/components/sidebar.tsx +0 -99
- package/src/components/snippets.tsx +0 -180
- package/src/contexts/component-generics.tsx +0 -48
- package/src/contexts/component-types.tsx +0 -5
- package/src/contexts/component.tsx +0 -32
- package/src/contexts/docs.tsx +0 -75
- package/src/contexts/index.tsx +0 -17
- package/src/contexts/markdown.tsx +0 -43
- package/src/contexts/navigation.tsx +0 -44
- package/src/contexts/search.tsx +0 -28
- package/src/contexts/use-components.tsx +0 -4
- package/src/index.ts +0 -6
- package/src/languages/go.tsx +0 -281
- package/src/languages/http.tsx +0 -321
- package/src/languages/index.ts +0 -26
- package/src/languages/java.tsx +0 -358
- package/src/languages/python.tsx +0 -255
- package/src/languages/ruby.tsx +0 -320
- package/src/languages/typescript.tsx +0 -393
- package/src/markdown/index.ts +0 -107
- package/src/markdown/md.ts +0 -45
- package/src/markdown/utils.ts +0 -49
- package/src/routing.ts +0 -238
- package/src/search/form.tsx +0 -127
- package/src/search/index.tsx +0 -1
- package/src/search/indexer.ts +0 -246
- package/src/search/mcp.ts +0 -61
- package/src/search/printer.tsx +0 -86
- package/src/search/providers/algolia.ts +0 -88
- package/src/search/providers/fuse.ts +0 -19
- package/src/search/providers/pagefind.ts +0 -17
- package/src/search/providers/walker.ts +0 -30
- package/src/search/results.tsx +0 -182
- package/src/search/state.ts +0 -64
- package/src/search/types.ts +0 -116
- package/src/style.ts +0 -196
- package/src/styles/main.css +0 -986
- package/src/styles/primitives.css +0 -580
- package/src/styles/resets.css +0 -39
- package/src/styles/search.css +0 -341
- package/src/styles/sidebar.css +0 -85
- package/src/styles/snippets.css +0 -130
- package/src/styles/variables.css +0 -86
- package/src/utils.ts +0 -41
|
@@ -0,0 +1,45 @@
|
|
|
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";
|
|
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 };
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
|
22
|
+
export { MarkdownContext, MarkdownProvider, MarkdownProviderProps, useHighlight, useMarkdownContext, useRenderMarkdown };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useLanguage } from "./docs.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
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
|
|
49
|
+
export { MarkdownContext, MarkdownProvider, useHighlight, useMarkdownContext, useRenderMarkdown };
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
|
29
|
+
export { NavigationContextType, NavigationHandler, NavigationProvider, NavigationProviderProps, useNavigation };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
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
|
|
24
|
+
export { NavigationProvider, useNavigation };
|