@stainless-api/docs-ui 0.1.0-beta.3 → 0.1.0-beta.31
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/breadcrumbs-D2C-ipke.d.ts +20 -0
- package/dist/chunk-DsStOjWQ.js +13 -0
- package/dist/component-generics-CGwo6qAl.d.ts +30 -0
- package/dist/component-generics-D3ybuN5r.js +45 -0
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +15 -0
- package/dist/components/chat.d.ts +14 -0
- package/dist/components/chat.js +142 -0
- package/dist/components/icons.d.ts +50 -0
- package/dist/components/icons.js +3 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.js +15 -0
- package/dist/components/method.d.ts +2 -0
- package/dist/components/method.js +15 -0
- package/dist/components/overview.d.ts +2 -0
- package/dist/components/overview.js +15 -0
- package/dist/components/primitives.d.ts +2 -0
- package/dist/components/primitives.js +15 -0
- package/dist/components/properties.d.ts +2 -0
- package/dist/components/properties.js +15 -0
- package/dist/components/sdk.d.ts +3 -0
- package/dist/components/sdk.js +15 -0
- package/dist/components/sidebar.d.ts +2 -0
- package/dist/components/sidebar.js +15 -0
- package/dist/components/snippets.d.ts +4 -0
- package/dist/components/snippets.js +15 -0
- package/dist/contexts/component-generics.d.ts +2 -0
- package/dist/contexts/component-generics.js +3 -0
- package/dist/contexts/component-types.d.ts +17 -0
- package/dist/contexts/component-types.js +0 -0
- package/dist/contexts/component.d.ts +30 -0
- package/dist/contexts/component.js +15 -0
- package/dist/contexts/docs.d.ts +2 -0
- package/dist/contexts/docs.js +3 -0
- package/dist/contexts/index.d.ts +19 -0
- package/dist/contexts/index.js +15 -0
- package/dist/contexts/markdown.d.ts +2 -0
- package/dist/contexts/markdown.js +4 -0
- package/dist/contexts/navigation.d.ts +3 -0
- package/dist/contexts/navigation.js +3 -0
- package/dist/contexts/search.d.ts +4 -0
- package/dist/contexts/search.js +15 -0
- package/dist/contexts/use-components.d.ts +15 -0
- package/dist/contexts/use-components.js +4 -0
- package/dist/contexts-Bpupku3r.js +3804 -0
- package/dist/docs-C5sBbvz9.d.ts +46 -0
- package/dist/docs-CopwX9a7.js +54 -0
- package/dist/icons-yb-Jhkmg.js +753 -0
- package/dist/index-BZvOzjGA.d.ts +15 -0
- package/dist/index-Cwjt4PqJ.d.ts +240 -0
- package/dist/index-Cx9sLoAB.d.ts +14 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +15 -7542
- package/dist/languages/go.d.ts +12 -0
- package/dist/languages/go.js +15 -0
- package/dist/languages/http.d.ts +12 -0
- package/dist/languages/http.js +15 -0
- package/dist/languages/index.d.ts +12 -0
- package/dist/languages/index.js +15 -0
- package/dist/languages/java.d.ts +12 -0
- package/dist/languages/java.js +15 -0
- package/dist/languages/python.d.ts +12 -0
- package/dist/languages/python.js +15 -0
- package/dist/languages/ruby.d.ts +12 -0
- package/dist/languages/ruby.js +15 -0
- package/dist/languages/typescript.d.ts +12 -0
- package/dist/languages/typescript.js +15 -0
- package/dist/markdown/index.d.ts +12 -0
- package/dist/markdown/index.js +15 -0
- package/dist/markdown/md.d.ts +15 -0
- package/dist/markdown/md.js +3 -0
- package/dist/markdown/utils.d.ts +4 -0
- package/dist/markdown/utils.js +3 -0
- package/dist/markdown-CI4kbU64.js +44 -0
- package/dist/markdown-CswQW7Au.d.ts +22 -0
- package/dist/md-DxiV1_vy.js +41 -0
- package/dist/method-D0-gsw3H.d.ts +71 -0
- package/dist/navigation-Bc58Zt6l.d.ts +29 -0
- package/dist/navigation-CGr5_w6z.js +24 -0
- package/dist/overview-Ds69MW_g.d.ts +39 -0
- package/dist/pagefind-BaK1krMe.js +15 -0
- package/dist/primitives-DKSwbXPi.d.ts +99 -0
- package/dist/properties-4IkL0IVR.d.ts +46 -0
- package/dist/routing-8itEXLx6.js +189 -0
- package/dist/routing-ByeZ2P3d.d.ts +54 -0
- package/dist/routing.d.ts +2 -0
- package/dist/routing.js +3 -180
- package/dist/sdk-D1acaxlr.d.ts +119 -0
- package/dist/search/index.d.ts +26 -0
- package/dist/search/index.js +334 -0
- package/dist/search/providers/algolia.d.ts +24 -0
- package/dist/search/providers/algolia.js +15 -0
- package/dist/search/providers/fuse.d.ts +18 -0
- package/dist/search/providers/fuse.js +30 -0
- package/dist/search/providers/pagefind.d.ts +7 -0
- package/dist/search/providers/pagefind.js +3 -0
- package/dist/search/providers/walker.d.ts +9 -0
- package/dist/search/providers/walker.js +34 -0
- package/dist/search/types.d.ts +3 -0
- package/dist/search/types.js +3 -0
- package/dist/search-BwZ0UK72.d.ts +21 -0
- package/dist/sidebar-rqdLbjBO.d.ts +36 -0
- package/dist/snippets-Coq_j3S0.d.ts +46 -0
- package/dist/style-BEMLtSIK.d.ts +172 -0
- package/dist/style-CPgcT0Fw.js +173 -0
- package/dist/style.d.ts +2 -0
- package/dist/style.js +3 -0
- package/dist/styles/main.css +763 -736
- package/dist/styles/main.js +0 -0
- package/dist/styles/primitives.css +285 -464
- package/dist/styles/primitives.js +0 -0
- package/dist/styles/resets.css +31 -41
- package/dist/styles/resets.js +0 -0
- package/dist/styles/search.css +266 -248
- package/dist/styles/search.js +0 -0
- package/dist/styles/sidebar.css +59 -60
- package/dist/styles/sidebar.js +0 -0
- package/dist/styles/snippets.css +87 -88
- package/dist/styles/snippets.js +0 -0
- package/dist/styles/variables.css +87 -89
- package/dist/styles/variables.js +0 -0
- package/dist/types-BKUIuYYk.d.ts +83 -0
- package/dist/types-__XoFvJ_.js +34 -0
- package/dist/use-components-BHEwm0mE.js +7 -0
- package/dist/utils-2FmcHPHp.js +32 -0
- package/dist/utils-BCfb0F9R.js +30 -0
- package/dist/utils-D43p_yTd.d.ts +14 -0
- package/dist/utils-NYMx28lc.d.ts +21 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +4 -0
- package/package.json +78 -16
- package/dist/mcp.js +0 -16003
- 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 -144
- package/src/components/overview.tsx +0 -159
- 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 -402
- package/src/components/sidebar.tsx +0 -99
- package/src/components/snippets.tsx +0 -179
- 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 -181
- package/src/search/state.ts +0 -64
- package/src/search/types.ts +0 -116
- package/src/style.ts +0 -197
- package/src/styles/main.css +0 -993
- package/src/styles/primitives.css +0 -572
- package/src/styles/resets.css +0 -47
- package/src/styles/search.css +0 -342
- package/src/styles/sidebar.css +0 -87
- package/src/styles/snippets.css +0 -132
- package/src/styles/variables.css +0 -90
- package/src/utils.ts +0 -41
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { t as __export } from "./chunk-DsStOjWQ.js";
|
|
2
|
+
import { f as parseStainlessPath } from "./routing-8itEXLx6.js";
|
|
3
|
+
|
|
4
|
+
//#region src/utils.ts
|
|
5
|
+
var utils_exports = /* @__PURE__ */ __export({
|
|
6
|
+
flatResources: () => flatResources,
|
|
7
|
+
getResourceFromSpec: () => getResourceFromSpec,
|
|
8
|
+
isResourceEmpty: () => isResourceEmpty
|
|
9
|
+
});
|
|
10
|
+
function flatResources(resources, parents) {
|
|
11
|
+
return Object.keys(resources ?? {}).flatMap((key) => {
|
|
12
|
+
const resource = resources[key];
|
|
13
|
+
return [{
|
|
14
|
+
resource,
|
|
15
|
+
parents
|
|
16
|
+
}, ...resource.subresources ? flatResources(resource.subresources, [...parents, resource]) : []];
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function getResourceFromSpec(stainlessPath, spec) {
|
|
20
|
+
if (typeof stainlessPath === "string") {
|
|
21
|
+
const parsed = parseStainlessPath(stainlessPath);
|
|
22
|
+
if (!parsed?.resource) return null;
|
|
23
|
+
stainlessPath = parsed.resource;
|
|
24
|
+
}
|
|
25
|
+
return stainlessPath.slice(1).reduce((acc, cur) => acc?.subresources?.[cur], spec.resources[stainlessPath[0]]) ?? null;
|
|
26
|
+
}
|
|
27
|
+
function isResourceEmpty(resource) {
|
|
28
|
+
return !(Object.values(resource.methods).length > 0 || Object.values(resource.models).length > 0 || Object.values(resource.subresources).length > 0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { utils_exports as i, getResourceFromSpec as n, isResourceEmpty as r, flatResources as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Parser } from "htmlparser2";
|
|
2
|
+
|
|
3
|
+
//#region src/markdown/utils.ts
|
|
4
|
+
function getDecl(env, path) {
|
|
5
|
+
const decl = env.spec?.decls?.[env.language]?.[path];
|
|
6
|
+
if (decl?.kind?.endsWith("Reference")) {
|
|
7
|
+
const refId = "type" in decl && typeof decl["type"] === "object" && "$ref" in decl["type"] ? decl["type"]["$ref"] : null;
|
|
8
|
+
if (refId === path) return decl;
|
|
9
|
+
if (refId) return getDecl(env, refId);
|
|
10
|
+
}
|
|
11
|
+
return decl;
|
|
12
|
+
}
|
|
13
|
+
function getSnippet(env, path) {
|
|
14
|
+
let snippet = env.spec?.snippets?.[`${env.language}.default`]?.[path];
|
|
15
|
+
if (typeof snippet === "string" && env.transforms?.transformRequestSnippet) snippet = env.transforms.transformRequestSnippet({
|
|
16
|
+
snippet,
|
|
17
|
+
language: env.language
|
|
18
|
+
});
|
|
19
|
+
return snippet;
|
|
20
|
+
}
|
|
21
|
+
function stripMarkup(content) {
|
|
22
|
+
let output = "";
|
|
23
|
+
new Parser({ ontext(content$1) {
|
|
24
|
+
output += content$1;
|
|
25
|
+
} }).parseComplete(content);
|
|
26
|
+
return output;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { getSnippet as n, stripMarkup as r, getDecl as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as SDKJSON from "@stainless/sdk-json";
|
|
2
|
+
|
|
3
|
+
//#region src/utils.d.ts
|
|
4
|
+
declare namespace utils_d_exports {
|
|
5
|
+
export { flatResources, getResourceFromSpec, isResourceEmpty };
|
|
6
|
+
}
|
|
7
|
+
declare function flatResources(resources: Record<string, SDKJSON.Resource> | undefined, parents: SDKJSON.Resource[]): {
|
|
8
|
+
resource: SDKJSON.Resource;
|
|
9
|
+
parents: SDKJSON.Resource[];
|
|
10
|
+
}[];
|
|
11
|
+
declare function getResourceFromSpec(stainlessPath: string | string[], spec: SDKJSON.Spec): SDKJSON.Resource | null;
|
|
12
|
+
declare function isResourceEmpty(resource: SDKJSON.Resource): boolean;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { utils_d_exports as i, getResourceFromSpec as n, isResourceEmpty as r, flatResources as t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { t as DocsLanguage } from "./routing-ByeZ2P3d.js";
|
|
2
|
+
import { C as TransformRequestSnippetFn } from "./sdk-D1acaxlr.js";
|
|
3
|
+
import * as SDKJSON from "@stainless/sdk-json";
|
|
4
|
+
|
|
5
|
+
//#region src/markdown/utils.d.ts
|
|
6
|
+
type EnvironmentType = {
|
|
7
|
+
spec: SDKJSON.Spec;
|
|
8
|
+
language: DocsLanguage;
|
|
9
|
+
transforms?: {
|
|
10
|
+
transformRequestSnippet?: TransformRequestSnippetFn;
|
|
11
|
+
};
|
|
12
|
+
options: {
|
|
13
|
+
renderNestedResources?: boolean;
|
|
14
|
+
includeModelProperties?: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
declare function getDecl(env: EnvironmentType, path: string): SDKJSON.LanguageDeclNodes[SDKJSON.SpecLanguage] | undefined;
|
|
18
|
+
declare function getSnippet(env: EnvironmentType, path: string): string | undefined;
|
|
19
|
+
declare function stripMarkup(content: string): string;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { stripMarkup as i, getDecl as n, getSnippet as r, EnvironmentType as t };
|
package/dist/utils.d.ts
ADDED
package/dist/utils.js
ADDED
package/package.json
CHANGED
|
@@ -1,38 +1,100 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stainless-api/docs-ui",
|
|
3
|
-
"
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.1.0-beta.31",
|
|
4
5
|
"publishConfig": {
|
|
5
6
|
"access": "public"
|
|
6
7
|
},
|
|
7
8
|
"type": "module",
|
|
8
9
|
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
"src"
|
|
10
|
+
"dist"
|
|
11
11
|
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./routing": {
|
|
17
|
+
"default": "./dist/routing.js"
|
|
18
|
+
},
|
|
19
|
+
"./utils": {
|
|
20
|
+
"default": "./dist/utils.js"
|
|
21
|
+
},
|
|
22
|
+
"./components": {
|
|
23
|
+
"default": "./dist/components/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./components/scripts/*": {
|
|
26
|
+
"default": "./dist/components/scripts/*.js"
|
|
27
|
+
},
|
|
28
|
+
"./components/*": {
|
|
29
|
+
"default": "./dist/components/*.js"
|
|
30
|
+
},
|
|
31
|
+
"./languages": {
|
|
32
|
+
"default": "./dist/languages/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./languages/*": {
|
|
35
|
+
"default": "./dist/languages/*.js"
|
|
36
|
+
},
|
|
37
|
+
"./contexts": {
|
|
38
|
+
"default": "./dist/contexts/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./contexts/*": {
|
|
41
|
+
"default": "./dist/contexts/*.js"
|
|
42
|
+
},
|
|
43
|
+
"./style": {
|
|
44
|
+
"default": "./dist/style.js"
|
|
45
|
+
},
|
|
46
|
+
"./styles/*": {
|
|
47
|
+
"default": "./dist/styles/*"
|
|
48
|
+
},
|
|
49
|
+
"./markdown": {
|
|
50
|
+
"default": "./dist/markdown/index.js"
|
|
51
|
+
},
|
|
52
|
+
"./markdown/*": {
|
|
53
|
+
"default": "./dist/markdown/*.js"
|
|
54
|
+
},
|
|
55
|
+
"./search": {
|
|
56
|
+
"default": "./dist/search/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./search/types": {
|
|
59
|
+
"default": "./dist/search/types.js"
|
|
60
|
+
},
|
|
61
|
+
"./search/providers/*": {
|
|
62
|
+
"default": "./dist/search/providers/*.js"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"react": ">=19.0.0",
|
|
67
|
+
"react-dom": ">=19.0.0"
|
|
68
|
+
},
|
|
12
69
|
"dependencies": {
|
|
13
70
|
"@algolia/client-search": "^5.25.0",
|
|
71
|
+
"@langchain/community": "^0.3.16",
|
|
14
72
|
"@markdoc/markdoc": "^0.5.2",
|
|
15
73
|
"ai": "4.3.19",
|
|
16
74
|
"clsx": "^2.1.1",
|
|
17
75
|
"fuse.js": "^7.1.0",
|
|
18
76
|
"htmlparser2": "^10.0.0",
|
|
19
|
-
"lucide-react": "^0.
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"@stainless-api/ui-primitives": "0.1.0-beta.4"
|
|
77
|
+
"lucide-react": "^0.553.0",
|
|
78
|
+
"natural": "^8.0.1",
|
|
79
|
+
"@stainless-api/ui-primitives": "0.1.0-beta.24"
|
|
23
80
|
},
|
|
24
81
|
"devDependencies": {
|
|
25
|
-
"@types/node": "
|
|
26
|
-
"@types/react": "^19.
|
|
27
|
-
"@types/react-dom": "^19.
|
|
28
|
-
"dotenv": "17.2.
|
|
29
|
-
"
|
|
82
|
+
"@types/node": "24.5.1",
|
|
83
|
+
"@types/react": "^19.2.4",
|
|
84
|
+
"@types/react-dom": "^19.2.3",
|
|
85
|
+
"dotenv": "17.2.3",
|
|
86
|
+
"react": "^19.2.0",
|
|
87
|
+
"react-dom": "^19.2.0",
|
|
88
|
+
"tsdown": "^0.16.4",
|
|
30
89
|
"tsx": "^4.20.3",
|
|
31
|
-
"
|
|
90
|
+
"typescript": "5.9.3",
|
|
91
|
+
"@stainless/eslint-config": "0.1.0-beta.0",
|
|
92
|
+
"@stainless/sdk-json": "^0.1.0-beta.0"
|
|
32
93
|
},
|
|
33
94
|
"scripts": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"lint": "eslint ."
|
|
95
|
+
"build": "tsdown",
|
|
96
|
+
"clean": "rm -rf dist",
|
|
97
|
+
"lint": "eslint .",
|
|
98
|
+
"check:types": "tsc --noEmit"
|
|
37
99
|
}
|
|
38
100
|
}
|