@stainless-api/docs-ui 0.1.0-beta.10 → 0.1.0-beta.11

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 (225) hide show
  1. package/dist/breadcrumbs-Z-hEqjcp.d.ts +19 -0
  2. package/dist/chunk-Bp6m_JJh.js +13 -0
  3. package/dist/component-generics-DzI21jRn.js +35 -0
  4. package/dist/component-generics-q5Dqiu2D.d.ts +30 -0
  5. package/dist/components/breadcrumbs.d.ts +2 -11
  6. package/dist/components/breadcrumbs.js +16 -52
  7. package/dist/components/chat.d.ts +13 -5
  8. package/dist/components/chat.js +138 -74
  9. package/dist/components/dropdown.d.ts +2 -17
  10. package/dist/components/dropdown.js +4 -18
  11. package/dist/components/icons.d.ts +50 -27
  12. package/dist/components/icons.js +3 -34
  13. package/dist/components/index.d.ts +12 -9
  14. package/dist/components/index.js +16 -10
  15. package/dist/components/method.d.ts +2 -41
  16. package/dist/components/method.js +16 -44
  17. package/dist/components/overview.d.ts +2 -21
  18. package/dist/components/overview.js +16 -49
  19. package/dist/components/primitives.d.ts +2 -60
  20. package/dist/components/primitives.js +16 -117
  21. package/dist/components/properties.d.ts +2 -24
  22. package/dist/components/properties.js +16 -24
  23. package/dist/components/scripts/dropdown.d.ts +11 -4
  24. package/dist/components/scripts/dropdown.js +49 -63
  25. package/dist/components/sdk.d.ts +3 -78
  26. package/dist/components/sdk.js +16 -153
  27. package/dist/components/sidebar.d.ts +2 -22
  28. package/dist/components/sidebar.js +16 -30
  29. package/dist/components/snippets.d.ts +4 -28
  30. package/dist/components/snippets.js +16 -76
  31. package/dist/contexts/component-generics.d.ts +2 -25
  32. package/dist/contexts/component-generics.js +3 -24
  33. package/dist/contexts/component-types.d.ts +18 -4
  34. package/dist/contexts/component-types.js +1 -2
  35. package/dist/contexts/component.d.ts +31 -14
  36. package/dist/contexts/component.js +16 -14
  37. package/dist/contexts/docs.d.ts +2 -34
  38. package/dist/contexts/docs.js +3 -43
  39. package/dist/contexts/index.d.ts +20 -7
  40. package/dist/contexts/index.js +16 -15
  41. package/dist/contexts/markdown.d.ts +2 -13
  42. package/dist/contexts/markdown.js +4 -29
  43. package/dist/contexts/navigation.d.ts +3 -19
  44. package/dist/contexts/navigation.js +3 -14
  45. package/dist/contexts/search.d.ts +4 -13
  46. package/dist/contexts/search.js +16 -15
  47. package/dist/contexts/use-components.d.ts +16 -1
  48. package/dist/contexts/use-components.js +4 -3
  49. package/dist/contexts-DRxRO-xO.js +3747 -0
  50. package/dist/docs-Dh8kE1va.js +50 -0
  51. package/dist/docs-EUy-wfbA.d.ts +43 -0
  52. package/dist/dropdown-B7VyGMOw.d.ts +43 -0
  53. package/dist/dropdown-DtgAi6lb.js +62 -0
  54. package/dist/icons-DdKM-01E.js +753 -0
  55. package/dist/index-AicgPYKB.d.ts +239 -0
  56. package/dist/index-BhwLhiWk.d.ts +14 -0
  57. package/dist/index-YnpUtXLB.d.ts +16 -0
  58. package/dist/index.d.ts +22 -6
  59. package/dist/index.js +16 -7
  60. package/dist/languages/go.d.ts +13 -21
  61. package/dist/languages/go.js +16 -116
  62. package/dist/languages/http.d.ts +13 -25
  63. package/dist/languages/http.js +16 -130
  64. package/dist/languages/index.d.ts +13 -37
  65. package/dist/languages/index.js +16 -10
  66. package/dist/languages/java.d.ts +13 -23
  67. package/dist/languages/java.js +16 -120
  68. package/dist/languages/python.d.ts +13 -22
  69. package/dist/languages/python.js +16 -104
  70. package/dist/languages/ruby.d.ts +13 -22
  71. package/dist/languages/ruby.js +16 -125
  72. package/dist/languages/typescript.d.ts +13 -22
  73. package/dist/languages/typescript.js +16 -134
  74. package/dist/markdown/index.d.ts +11 -6
  75. package/dist/markdown/index.js +16 -80
  76. package/dist/markdown/md.d.ts +15 -11
  77. package/dist/markdown/md.js +3 -34
  78. package/dist/markdown/utils.d.ts +4 -17
  79. package/dist/markdown/utils.js +3 -30
  80. package/dist/markdown-BXfX1D7C.js +42 -0
  81. package/dist/markdown-nFyAEX_K.d.ts +22 -0
  82. package/dist/md-Dg8aOyMA.js +41 -0
  83. package/dist/method-DpsVuzZW.d.ts +71 -0
  84. package/dist/navigation-aoYZ_tl4.js +24 -0
  85. package/dist/navigation-nyXBY-75.d.ts +29 -0
  86. package/dist/overview-C8e-6jGr.d.ts +38 -0
  87. package/dist/pagefind-ChrPfuVv.js +15 -0
  88. package/dist/primitives-DWz23_Ub.d.ts +99 -0
  89. package/dist/properties-CF71V58d.d.ts +46 -0
  90. package/dist/routing-DQjbRxdJ.js +189 -0
  91. package/dist/routing-qc0V00-j.d.ts +51 -0
  92. package/dist/routing.d.ts +2 -44
  93. package/dist/routing.js +3 -169
  94. package/dist/sdk-Zg3Rggk3.d.ts +118 -0
  95. package/dist/search/index.d.ts +26 -1
  96. package/dist/search/index.js +332 -2
  97. package/dist/search/providers/algolia.d.ts +22 -7
  98. package/dist/search/providers/algolia.js +16 -64
  99. package/dist/search/providers/fuse.d.ts +16 -9
  100. package/dist/search/providers/fuse.js +29 -12
  101. package/dist/search/providers/pagefind.d.ts +7 -2
  102. package/dist/search/providers/pagefind.js +3 -19
  103. package/dist/search/providers/walker.d.ts +8 -5
  104. package/dist/search/providers/walker.js +28 -19
  105. package/dist/search/types.d.ts +3 -79
  106. package/dist/search/types.js +3 -24
  107. package/dist/search-B6loAGmB.d.ts +21 -0
  108. package/dist/sidebar-C8KirYjg.d.ts +35 -0
  109. package/dist/snippets-EUzM4fRO.d.ts +45 -0
  110. package/dist/style-pN9hCoec.d.ts +181 -0
  111. package/dist/style-rYbbxIR_.js +182 -0
  112. package/dist/style.d.ts +2 -179
  113. package/dist/style.js +3 -179
  114. package/dist/styles/main.css +740 -746
  115. package/dist/styles/main.js +1 -0
  116. package/dist/styles/primitives.css +436 -428
  117. package/dist/styles/primitives.js +1 -0
  118. package/dist/styles/resets.css +34 -41
  119. package/dist/styles/resets.js +1 -0
  120. package/dist/styles/search.css +248 -248
  121. package/dist/styles/search.js +1 -0
  122. package/dist/styles/sidebar.css +59 -60
  123. package/dist/styles/sidebar.js +1 -0
  124. package/dist/styles/snippets.css +87 -88
  125. package/dist/styles/snippets.js +1 -0
  126. package/dist/styles/variables.css +86 -89
  127. package/dist/styles/variables.js +1 -0
  128. package/dist/types-CTBDtD34.d.ts +82 -0
  129. package/dist/types-DFN4M1Sp.js +34 -0
  130. package/dist/use-components-D9E85p5x.js +7 -0
  131. package/dist/utils-BHwvUDKn.js +30 -0
  132. package/dist/utils-CJfFBNgT.js +32 -0
  133. package/dist/utils-DQhEbvUC.d.ts +20 -0
  134. package/dist/utils-nDazhti8.d.ts +11 -0
  135. package/dist/utils.d.ts +2 -7
  136. package/dist/utils.js +4 -27
  137. package/package.json +2 -2
  138. package/dist/components/breadcrumbs.js.map +0 -1
  139. package/dist/components/chat.js.map +0 -1
  140. package/dist/components/dropdown.js.map +0 -1
  141. package/dist/components/icons.js.map +0 -1
  142. package/dist/components/index.js.map +0 -1
  143. package/dist/components/method.js.map +0 -1
  144. package/dist/components/overview.js.map +0 -1
  145. package/dist/components/primitives.js.map +0 -1
  146. package/dist/components/properties.js.map +0 -1
  147. package/dist/components/scripts/dropdown.js.map +0 -1
  148. package/dist/components/sdk.js.map +0 -1
  149. package/dist/components/sidebar.js.map +0 -1
  150. package/dist/components/snippets.js.map +0 -1
  151. package/dist/contexts/component-generics.js.map +0 -1
  152. package/dist/contexts/component-types.js.map +0 -1
  153. package/dist/contexts/component.js.map +0 -1
  154. package/dist/contexts/docs.js.map +0 -1
  155. package/dist/contexts/index.js.map +0 -1
  156. package/dist/contexts/markdown.js.map +0 -1
  157. package/dist/contexts/navigation.js.map +0 -1
  158. package/dist/contexts/search.js.map +0 -1
  159. package/dist/contexts/use-components.js.map +0 -1
  160. package/dist/index.js.map +0 -1
  161. package/dist/languages/go.js.map +0 -1
  162. package/dist/languages/http.js.map +0 -1
  163. package/dist/languages/index.js.map +0 -1
  164. package/dist/languages/java.js.map +0 -1
  165. package/dist/languages/python.js.map +0 -1
  166. package/dist/languages/ruby.js.map +0 -1
  167. package/dist/languages/typescript.js.map +0 -1
  168. package/dist/markdown/index.js.map +0 -1
  169. package/dist/markdown/md.js.map +0 -1
  170. package/dist/markdown/utils.js.map +0 -1
  171. package/dist/mcp.js +0 -16105
  172. package/dist/routing.js.map +0 -1
  173. package/dist/search/form.d.ts +0 -13
  174. package/dist/search/form.js +0 -55
  175. package/dist/search/form.js.map +0 -1
  176. package/dist/search/index.js.map +0 -1
  177. package/dist/search/indexer.d.ts +0 -31
  178. package/dist/search/indexer.js +0 -212
  179. package/dist/search/indexer.js.map +0 -1
  180. package/dist/search/mcp.d.ts +0 -8
  181. package/dist/search/mcp.js +0 -43
  182. package/dist/search/mcp.js.map +0 -1
  183. package/dist/search/printer.d.ts +0 -6
  184. package/dist/search/printer.js +0 -43
  185. package/dist/search/printer.js.map +0 -1
  186. package/dist/search/providers/algolia.js.map +0 -1
  187. package/dist/search/providers/fuse.js.map +0 -1
  188. package/dist/search/providers/pagefind.js.map +0 -1
  189. package/dist/search/providers/walker.js.map +0 -1
  190. package/dist/search/results.d.ts +0 -21
  191. package/dist/search/results.js +0 -58
  192. package/dist/search/results.js.map +0 -1
  193. package/dist/search/state.d.ts +0 -29
  194. package/dist/search/state.js +0 -38
  195. package/dist/search/state.js.map +0 -1
  196. package/dist/search/types.js.map +0 -1
  197. package/dist/style.js.map +0 -1
  198. package/dist/types/sdkjson.d.ts +0 -1
  199. package/dist/types/sdkjson.js +0 -2
  200. package/dist/types/sdkjson.js.map +0 -1
  201. package/dist/types/stainless-alias/lib/json-spec-v2/GoAST.d.ts +0 -120
  202. package/dist/types/stainless-alias/lib/json-spec-v2/GoAST.js +0 -2
  203. package/dist/types/stainless-alias/lib/json-spec-v2/GoAST.js.map +0 -1
  204. package/dist/types/stainless-alias/lib/json-spec-v2/HttpAST.d.ts +0 -100
  205. package/dist/types/stainless-alias/lib/json-spec-v2/HttpAST.js +0 -3
  206. package/dist/types/stainless-alias/lib/json-spec-v2/HttpAST.js.map +0 -1
  207. package/dist/types/stainless-alias/lib/json-spec-v2/JavaAST.d.ts +0 -87
  208. package/dist/types/stainless-alias/lib/json-spec-v2/JavaAST.js +0 -2
  209. package/dist/types/stainless-alias/lib/json-spec-v2/JavaAST.js.map +0 -1
  210. package/dist/types/stainless-alias/lib/json-spec-v2/PythonAST.d.ts +0 -110
  211. package/dist/types/stainless-alias/lib/json-spec-v2/PythonAST.js +0 -3
  212. package/dist/types/stainless-alias/lib/json-spec-v2/PythonAST.js.map +0 -1
  213. package/dist/types/stainless-alias/lib/json-spec-v2/RubyAST.d.ts +0 -122
  214. package/dist/types/stainless-alias/lib/json-spec-v2/RubyAST.js +0 -2
  215. package/dist/types/stainless-alias/lib/json-spec-v2/RubyAST.js.map +0 -1
  216. package/dist/types/stainless-alias/lib/json-spec-v2/TSAST.d.ts +0 -146
  217. package/dist/types/stainless-alias/lib/json-spec-v2/TSAST.js +0 -3
  218. package/dist/types/stainless-alias/lib/json-spec-v2/TSAST.js.map +0 -1
  219. package/dist/types/stainless-alias/lib/json-spec-v2/TerraformAST.d.ts +0 -89
  220. package/dist/types/stainless-alias/lib/json-spec-v2/TerraformAST.js +0 -3
  221. package/dist/types/stainless-alias/lib/json-spec-v2/TerraformAST.js.map +0 -1
  222. package/dist/types/stainless-alias/lib/json-spec-v2/types.d.ts +0 -190
  223. package/dist/types/stainless-alias/lib/json-spec-v2/types.js +0 -105
  224. package/dist/types/stainless-alias/lib/json-spec-v2/types.js.map +0 -1
  225. package/dist/utils.js.map +0 -1
@@ -1,64 +1,16 @@
1
- import { searchClient } from '@algolia/client-search';
2
- import { generateChatIndex, generateIndex } from '../indexer';
3
- import { SearchableAttributes, SearchableAttributesChat } from '../types';
4
- export async function buildIndex(appId, indexName, writeKey, spec, renderMarkdown) {
5
- if (!appId || !indexName || !writeKey)
6
- return;
7
- const objects = Array.from(generateIndex(spec, renderMarkdown));
8
- const client = searchClient(appId, writeKey);
9
- await client.setSettings({
10
- indexName,
11
- indexSettings: {
12
- highlightPreTag: '<mark>',
13
- highlightPostTag: '</mark>',
14
- customRanking: ['asc(priority)'],
15
- attributesForFaceting: ['language', 'kind'],
16
- searchableAttributes: SearchableAttributes,
17
- },
18
- });
19
- await client.replaceAllObjects({ indexName, objects });
20
- }
21
- export async function buildChatIndex(appId, indexName, writeKey, spec) {
22
- if (!appId || !indexName || !writeKey)
23
- return;
24
- const objects = Array.from(generateChatIndex(spec));
25
- const client = searchClient(appId, writeKey);
26
- await client.setSettings({
27
- indexName,
28
- indexSettings: {
29
- attributesForFaceting: ['language'],
30
- attributeForDistinct: 'stainlessPath',
31
- searchableAttributes: SearchableAttributesChat,
32
- },
33
- });
34
- await client.replaceAllObjects({ indexName, objects });
35
- }
36
- export async function search({ settings: { appId, indexName, searchKey }, params: { query, language, kind }, }) {
37
- const client = searchClient(appId, searchKey);
38
- const filters = language ? `language:${language}` : undefined;
39
- const facetFilters = kind ? [`kind:${kind}`] : undefined;
40
- const { results } = await client.search({
41
- requests: [
42
- {
43
- query,
44
- indexName,
45
- filters,
46
- hitsPerPage: 5,
47
- facets: ['kind'],
48
- },
49
- {
50
- query,
51
- indexName,
52
- filters,
53
- facetFilters,
54
- facets: ['kind'],
55
- hitsPerPage: 50,
56
- },
57
- ],
58
- });
59
- if ('hits' in results[0] && 'hits' in results[1]) {
60
- const [{ nbHits, facets }, { hits }] = results;
61
- return { hits, nbHits, facets };
62
- }
63
- }
64
- //# sourceMappingURL=algolia.js.map
1
+ import "../../component-generics-DzI21jRn.js";
2
+ import "../../docs-Dh8kE1va.js";
3
+ import "../../navigation-aoYZ_tl4.js";
4
+ import "../../markdown-BXfX1D7C.js";
5
+ import "../../routing-DQjbRxdJ.js";
6
+ import "../../style-rYbbxIR_.js";
7
+ import "../../use-components-D9E85p5x.js";
8
+ import { c as search, o as buildChatIndex, s as buildIndex } from "../../contexts-DRxRO-xO.js";
9
+ import "../../icons-DdKM-01E.js";
10
+ import "../../utils-CJfFBNgT.js";
11
+ import "../../dropdown-DtgAi6lb.js";
12
+ import "../../md-Dg8aOyMA.js";
13
+ import "../../utils-BHwvUDKn.js";
14
+ import "../../types-DFN4M1Sp.js";
15
+
16
+ export { buildChatIndex, buildIndex, search };
@@ -1,10 +1,17 @@
1
- import { FuseIndex } from 'fuse.js';
2
- import { DocsLanguage } from '../../routing';
3
- import { IndexEntry } from '../types';
4
- import type { SDKJSON } from '../../types/sdkjson';
5
- export type FuseIndexData = {
6
- content: IndexEntry[];
7
- index: FuseIndex<IndexEntry>;
1
+ import { t as DocsLanguage } from "../../routing-qc0V00-j.js";
2
+ import { n as IndexEntry } from "../../types-CTBDtD34.js";
3
+ import * as fuse_js0 from "fuse.js";
4
+ import { FuseIndex } from "fuse.js";
5
+
6
+ //#region src/search/providers/fuse.d.ts
7
+ type FuseIndexData = {
8
+ content: IndexEntry[];
9
+ index: FuseIndex<IndexEntry>;
8
10
  };
9
- export declare function buildIndex(spec: SDKJSON.Spec, language?: DocsLanguage): FuseIndexData;
10
- export declare function search({ content, index }: FuseIndexData, query: string, limit?: number): import("fuse.js").FuseResult<IndexEntry>[];
11
+ declare function buildIndex(spec: SDKJSON.Spec, language?: DocsLanguage): FuseIndexData;
12
+ declare function search({
13
+ content,
14
+ index
15
+ }: FuseIndexData, query: string, limit?: number): fuse_js0.FuseResult<IndexEntry>[];
16
+ //#endregion
17
+ export { FuseIndexData, buildIndex, search };
@@ -1,14 +1,31 @@
1
- import Fuse from 'fuse.js';
2
- import { generateIndex } from '../indexer';
3
- import { SearchableAttributes } from '../types';
4
- export function buildIndex(spec, language) {
5
- const idx = Array.from(generateIndex(spec, null, false));
6
- const content = language ? idx.filter((entry) => entry.language === language) : idx;
7
- const index = Fuse.createIndex(SearchableAttributes, content);
8
- return { content, index };
1
+ import "../../component-generics-DzI21jRn.js";
2
+ import "../../docs-Dh8kE1va.js";
3
+ import "../../navigation-aoYZ_tl4.js";
4
+ import "../../markdown-BXfX1D7C.js";
5
+ import "../../routing-DQjbRxdJ.js";
6
+ import "../../style-rYbbxIR_.js";
7
+ import "../../use-components-D9E85p5x.js";
8
+ import { l as generateIndex } from "../../contexts-DRxRO-xO.js";
9
+ import "../../icons-DdKM-01E.js";
10
+ import "../../utils-CJfFBNgT.js";
11
+ import "../../dropdown-DtgAi6lb.js";
12
+ import "../../md-Dg8aOyMA.js";
13
+ import "../../utils-BHwvUDKn.js";
14
+ import { n as SearchableAttributes } from "../../types-DFN4M1Sp.js";
15
+ import Fuse from "fuse.js";
16
+
17
+ //#region src/search/providers/fuse.ts
18
+ function buildIndex(spec, language) {
19
+ const idx = Array.from(generateIndex(spec, null, false));
20
+ const content = language ? idx.filter((entry) => entry.language === language) : idx;
21
+ return {
22
+ content,
23
+ index: Fuse.createIndex(SearchableAttributes, content)
24
+ };
9
25
  }
10
- export function search({ content, index }, query, limit = 100) {
11
- const fuse = new Fuse(content, { keys: SearchableAttributes }, index);
12
- return fuse.search(query).slice(0, limit);
26
+ function search({ content, index }, query, limit = 100) {
27
+ return new Fuse(content, { keys: SearchableAttributes }, index).search(query).slice(0, limit);
13
28
  }
14
- //# sourceMappingURL=fuse.js.map
29
+
30
+ //#endregion
31
+ export { buildIndex, search };
@@ -1,2 +1,7 @@
1
- import type { GuideResultType } from '../types';
2
- export declare function guideSearch(loadPath: string, query: string, limit?: number): Promise<GuideResultType[]>;
1
+ import "../../routing-qc0V00-j.js";
2
+ import { t as GuideResultType } from "../../types-CTBDtD34.js";
3
+
4
+ //#region src/search/providers/pagefind.d.ts
5
+ declare function guideSearch(loadPath: string, query: string, limit?: number): Promise<GuideResultType[]>;
6
+ //#endregion
7
+ export { guideSearch };
@@ -1,19 +1,3 @@
1
- var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
2
- if (typeof path === "string" && /^\.\.?\//.test(path)) {
3
- return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
4
- return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
5
- });
6
- }
7
- return path;
8
- };
9
- async function loadPagefind(path) {
10
- const url = new URL(path, import.meta.url).href;
11
- return await import(__rewriteRelativeImportExtension(/* @vite-ignore */ url));
12
- }
13
- export async function guideSearch(loadPath, query, limit) {
14
- const index = await loadPagefind(loadPath);
15
- const response = await index.search(query);
16
- const items = limit ? response.results.slice(0, limit) : response.results;
17
- return Promise.all(items.map((result) => result.data().then((data) => ({ ...result, data }))));
18
- }
19
- //# sourceMappingURL=pagefind.js.map
1
+ import { t as guideSearch } from "../../pagefind-ChrPfuVv.js";
2
+
3
+ export { guideSearch };
@@ -1,5 +1,8 @@
1
- import { DocsLanguage } from '../../routing';
2
- import { IndexEntry } from '../types';
3
- import type { SDKJSON } from '../../types/sdkjson';
4
- export declare function buildIndex(spec: SDKJSON.Spec): Generator<IndexEntry, any, any>;
5
- export declare function search(index: Generator<IndexEntry>, language: DocsLanguage, query: string, limit?: number): IndexEntry[];
1
+ import { t as DocsLanguage } from "../../routing-qc0V00-j.js";
2
+ import { n as IndexEntry } from "../../types-CTBDtD34.js";
3
+
4
+ //#region src/search/providers/walker.d.ts
5
+ declare function buildIndex(spec: SDKJSON.Spec): Generator<IndexEntry, any, any>;
6
+ declare function search(index: Generator<IndexEntry>, language: DocsLanguage, query: string, limit?: number): IndexEntry[];
7
+ //#endregion
8
+ export { buildIndex, search };
@@ -1,23 +1,32 @@
1
- import { generateIndex } from '../indexer';
2
- import { SearchableAttributes } from '../types';
3
- export function buildIndex(spec) {
4
- return generateIndex(spec, null, false);
1
+ import "../../component-generics-DzI21jRn.js";
2
+ import "../../docs-Dh8kE1va.js";
3
+ import "../../navigation-aoYZ_tl4.js";
4
+ import "../../markdown-BXfX1D7C.js";
5
+ import "../../routing-DQjbRxdJ.js";
6
+ import "../../style-rYbbxIR_.js";
7
+ import "../../use-components-D9E85p5x.js";
8
+ import { l as generateIndex } from "../../contexts-DRxRO-xO.js";
9
+ import "../../icons-DdKM-01E.js";
10
+ import "../../utils-CJfFBNgT.js";
11
+ import "../../dropdown-DtgAi6lb.js";
12
+ import "../../md-Dg8aOyMA.js";
13
+ import "../../utils-BHwvUDKn.js";
14
+ import { n as SearchableAttributes } from "../../types-DFN4M1Sp.js";
15
+
16
+ //#region src/search/providers/walker.ts
17
+ function buildIndex(spec) {
18
+ return generateIndex(spec, null, false);
5
19
  }
6
20
  function* findEntryInIndex(index, language, query) {
7
- for (const entry of index) {
8
- if (entry.language !== language)
9
- continue;
10
- for (const attr of SearchableAttributes) {
11
- if (entry[attr] && typeof entry[attr] === 'string' && entry[attr].includes(query))
12
- yield entry;
13
- }
14
- }
21
+ for (const entry of index) {
22
+ if (entry.language !== language) continue;
23
+ for (const attr of SearchableAttributes) if (entry[attr] && typeof entry[attr] === "string" && entry[attr].includes(query)) yield entry;
24
+ }
15
25
  }
16
- export function search(index, language, query, limit = 100) {
17
- const results = findEntryInIndex(index, language, query);
18
- const sorted = Array.from(results)
19
- .sort((a, b) => a.priority - b.priority)
20
- .slice(0, limit);
21
- return sorted;
26
+ function search(index, language, query, limit = 100) {
27
+ const results = findEntryInIndex(index, language, query);
28
+ return Array.from(results).sort((a, b) => a.priority - b.priority).slice(0, limit);
22
29
  }
23
- //# sourceMappingURL=walker.js.map
30
+
31
+ //#endregion
32
+ export { buildIndex, search };
@@ -1,79 +1,3 @@
1
- import type { SDKJSON } from '../types/sdkjson';
2
- import { DocsLanguage } from '../routing';
3
- export type SearchSettings = {
4
- appId: string;
5
- searchKey: string;
6
- indexName: string;
7
- assistant?: string;
8
- };
9
- export type SearchParams = {
10
- query: string;
11
- language?: DocsLanguage | null;
12
- kind?: QueryKindsType | null;
13
- };
14
- export declare const QueryKinds: readonly ["all", "resource", "http_method", "model", "property", "guide"];
15
- export type QueryKindsType = (typeof QueryKinds)[number];
16
- export type IndexModel = {
17
- kind: 'model';
18
- title: string;
19
- children?: string[];
20
- ident?: string;
21
- };
22
- export type IndexProperty = {
23
- kind: 'property';
24
- docstring?: string;
25
- type?: string;
26
- };
27
- export type IndexResource = {
28
- kind: 'resource';
29
- title: string;
30
- Name: string;
31
- QualifiedName: string;
32
- };
33
- export type IndexMethod = Pick<SDKJSON.Method, 'kind' | 'summary' | 'description' | 'endpoint' | 'httpMethod'> & {
34
- title: string;
35
- qualified?: string;
36
- ident?: string;
37
- };
38
- export declare const SearchableAttributes: string[];
39
- export declare const SearchableAttributesChat: string[];
40
- export type SearchAttributeNames = (typeof SearchableAttributes)[number];
41
- export type RoutableJsonNode = SDKJSON.Method | SDKJSON.Model | SDKJSON.Resource;
42
- export type IndexEntry = Pick<RoutableJsonNode, 'name' | 'stainlessPath'> & (IndexProperty | IndexModel | IndexResource | IndexMethod) & {
43
- language: DocsLanguage;
44
- priority: number;
45
- crumbs: string[];
46
- };
47
- export type ResultRecordType = IndexEntry & {
48
- objectID: string;
49
- _highlightResult: Record<SearchAttributeNames, {
50
- value: string;
51
- }>;
52
- };
53
- export type ResultType = {
54
- hits: ResultRecordType[];
55
- facets?: Record<string, Record<string, number>>;
56
- nbHits: number;
57
- };
58
- export type GuideResultType = {
59
- id: string;
60
- score: number;
61
- words: number[];
62
- data: {
63
- excerpt: string;
64
- url: string;
65
- word_count: number;
66
- meta: {
67
- title: string;
68
- };
69
- sub_results: {
70
- url: string;
71
- title: string;
72
- excerpt: string;
73
- }[];
74
- };
75
- };
76
- export type ResultData = {
77
- items: Array<ResultRecordType | GuideResultType>;
78
- counts: Partial<Record<QueryKindsType, number>>;
79
- };
1
+ import "../routing-qc0V00-j.js";
2
+ import { _ as SearchableAttributesChat, a as IndexProperty, c as QueryKindsType, d as ResultType, f as RoutableJsonNode, g as SearchableAttributes, h as SearchSettings, i as IndexModel, l as ResultData, m as SearchParams, n as IndexEntry, o as IndexResource, p as SearchAttributeNames, r as IndexMethod, s as QueryKinds, t as GuideResultType, u as ResultRecordType } from "../types-CTBDtD34.js";
3
+ export { GuideResultType, IndexEntry, IndexMethod, IndexModel, IndexProperty, IndexResource, QueryKinds, QueryKindsType, ResultData, ResultRecordType, ResultType, RoutableJsonNode, SearchAttributeNames, SearchParams, SearchSettings, SearchableAttributes, SearchableAttributesChat };
@@ -1,24 +1,3 @@
1
- export const QueryKinds = ['all', 'resource', 'http_method', 'model', 'property', 'guide'];
2
- export const SearchableAttributes = [
3
- 'name',
4
- 'title',
5
- 'ident',
6
- 'Name',
7
- 'qualified',
8
- 'QualifiedName',
9
- 'endpoint',
10
- 'summary',
11
- 'description',
12
- 'docstring',
13
- ];
14
- export const SearchableAttributesChat = [
15
- 'title',
16
- 'name',
17
- 'endpoint',
18
- 'summary',
19
- 'description',
20
- 'qualified',
21
- 'ident',
22
- 'content',
23
- ];
24
- //# sourceMappingURL=types.js.map
1
+ import { n as SearchableAttributes, r as SearchableAttributesChat, t as QueryKinds } from "../types-DFN4M1Sp.js";
2
+
3
+ export { QueryKinds, SearchableAttributes, SearchableAttributesChat };
@@ -0,0 +1,21 @@
1
+ import { d as ResultType, h as SearchSettings, m as SearchParams } from "./types-CTBDtD34.js";
2
+ import * as React$1 from "react";
3
+ import * as react_jsx_runtime63 from "react/jsx-runtime";
4
+
5
+ //#region src/contexts/search.d.ts
6
+ type SearchContextType = {
7
+ settings: SearchSettings;
8
+ onSelect?: (stainlessPath: string) => void;
9
+ pageFind?: string;
10
+ };
11
+ declare function useSearchContext(): SearchContextType;
12
+ declare function useSearch(): (params: SearchParams) => Promise<ResultType | undefined>;
13
+ type SearchProviderProps = SearchContextType & {
14
+ children: React$1.ReactNode;
15
+ };
16
+ declare function SearchProvider({
17
+ children,
18
+ ...props
19
+ }: SearchProviderProps): react_jsx_runtime63.JSX.Element;
20
+ //#endregion
21
+ export { useSearchContext as a, useSearch as i, SearchProvider as n, SearchProviderProps as r, SearchContextType as t };
@@ -0,0 +1,35 @@
1
+ import * as React$1 from "react";
2
+ import * as react_jsx_runtime53 from "react/jsx-runtime";
3
+
4
+ //#region src/components/sidebar.d.ts
5
+ type SidebarExpanderProps = {
6
+ open?: boolean;
7
+ summary: React$1.ReactNode;
8
+ children?: React$1.ReactNode;
9
+ };
10
+ declare function SidebarExpander({
11
+ open,
12
+ summary,
13
+ children
14
+ }: SidebarExpanderProps): react_jsx_runtime53.JSX.Element;
15
+ type SidebarMethodProps = {
16
+ method: SDKJSON.Method;
17
+ };
18
+ declare function SidebarMethod({
19
+ method
20
+ }: SidebarMethodProps): react_jsx_runtime53.JSX.Element;
21
+ type SidebarResourceProps = {
22
+ resource: SDKJSON.Resource;
23
+ };
24
+ declare function SidebarResource({
25
+ resource
26
+ }: SidebarResourceProps): react_jsx_runtime53.JSX.Element;
27
+ type SidebarProps = {
28
+ resources: SDKJSON.Resource[];
29
+ selectedPath?: string;
30
+ };
31
+ declare function Sidebar({
32
+ resources
33
+ }: SidebarProps): react_jsx_runtime53.JSX.Element;
34
+ //#endregion
35
+ export { SidebarProps as a, SidebarMethodProps as i, SidebarExpander as n, SidebarResource as o, SidebarMethod as r, SidebarResourceProps as s, Sidebar as t };
@@ -0,0 +1,45 @@
1
+ import { C as TransformRequestSnippetFn } from "./sdk-Zg3Rggk3.js";
2
+ import * as React$1 from "react";
3
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
4
+
5
+ //#region src/components/snippets.d.ts
6
+ type SnippetCodeProps = {
7
+ content: string;
8
+ signature?: string;
9
+ language?: string;
10
+ };
11
+ declare function SnippetCode({
12
+ content,
13
+ language
14
+ }: SnippetCodeProps): react_jsx_runtime16.JSX.Element;
15
+ type SnippetProps = {
16
+ method: SDKJSON.Method;
17
+ requestTitle?: React$1.ReactNode;
18
+ transformRequestSnippet?: TransformRequestSnippetFn;
19
+ };
20
+ type SnippetContainerProps = {
21
+ children: React$1.ReactNode;
22
+ signature?: string;
23
+ };
24
+ declare function SnippetContainer({
25
+ children
26
+ }: SnippetContainerProps): react_jsx_runtime16.JSX.Element;
27
+ type SnippetRequestContainerProps = {
28
+ children?: React$1.ReactNode;
29
+ signature?: string;
30
+ };
31
+ declare function SnippetRequestContainer({
32
+ children
33
+ }: SnippetRequestContainerProps): react_jsx_runtime16.JSX.Element;
34
+ declare function Snippet({
35
+ requestTitle,
36
+ method,
37
+ transformRequestSnippet
38
+ }: SnippetProps): react_jsx_runtime16.JSX.Element;
39
+ declare function SnippetResponse({
40
+ responses
41
+ }: {
42
+ responses: SDKJSON.Method['exampleResponses'];
43
+ }): react_jsx_runtime16.JSX.Element | null;
44
+ //#endregion
45
+ export { SnippetContainerProps as a, SnippetRequestContainerProps as c, SnippetContainer as i, SnippetResponse as l, SnippetCode as n, SnippetProps as o, SnippetCodeProps as r, SnippetRequestContainer as s, Snippet as t };
@@ -0,0 +1,181 @@
1
+ //#region src/style.d.ts
2
+ declare const _default: {
3
+ readonly TextIdentifier: "stldocs-text-identifier";
4
+ readonly TextOperator: "stldocs-text-operator";
5
+ readonly TextPunctuation: "stldocs-text-punctuation";
6
+ readonly TextKeyword: "stldocs-text-keyword";
7
+ readonly ContentArea: "stldocs-content-area";
8
+ readonly Markdown: "stldocs-markdown";
9
+ readonly Content: "stldocs-content";
10
+ readonly Truncation: "stldocs-truncation";
11
+ readonly Expander: "stldocs-expander";
12
+ readonly ExpanderContent: "stldocs-expander-content";
13
+ readonly ExpanderSummary: "stldocs-expander-summary";
14
+ readonly ExpanderSummaryIcon: "stldocs-expander-summary-icon";
15
+ readonly ExpanderSummaryContent: "stldocs-expander-summary-content";
16
+ readonly ExpanderIndent: "stldocs-expander-indent";
17
+ readonly Badge: "stldocs-badge";
18
+ readonly Icon: "stldocs-icon";
19
+ readonly Tooltip: "stldocs-tooltip";
20
+ readonly TooltipHost: "stldocs-tooltip-host";
21
+ readonly TooltipContent: "stldocs-tooltip-content";
22
+ readonly Input: "stldocs-input";
23
+ readonly InputTextField: "stldocs-input-textfield";
24
+ readonly ToggleButton: "stldocs-togglebutton";
25
+ readonly ListView: "stldocs-listview";
26
+ readonly ListViewItem: "stldocs-listview-item";
27
+ readonly ExpandToggle: "stldocs-expand-toggle";
28
+ readonly ExpandToggleContent: "stldocs-expand-toggle-content";
29
+ readonly LoadingSpinner: "stldocs-loading-spinner";
30
+ readonly Type: "stldocs-type";
31
+ readonly TypeName: "stldocs-typename";
32
+ readonly TypeKeyword: "stldocs-type-keyword";
33
+ readonly TypeString: "stldocs-type-string";
34
+ readonly TypeArray: "stldocs-type-array";
35
+ readonly TypeReference: "stldocs-type-reference";
36
+ readonly TypeBracket: "stldocs-type-bracket";
37
+ readonly TypeBrace: "stldocs-type-brace";
38
+ readonly TypePropertyName: "stldocs-type-propertyname";
39
+ readonly TypePlain: "stldocs-type-plain";
40
+ readonly TypePreview: "stldocs-type-preview";
41
+ readonly TypePreviewContent: "stldocs-type-preview-content";
42
+ readonly LiteralString: "stldocs-literal-string";
43
+ readonly LiteralNumeric: "stldocs-literal-numeric";
44
+ readonly LiteralBoolean: "stldocs-literal-boolean";
45
+ readonly Snippet: "stldocs-snippet";
46
+ readonly SnippetCode: "stldocs-snippet-code";
47
+ readonly SnippetCodeContent: "stldocs-snippet-code-content";
48
+ readonly SnippetRequest: "stldocs-snippet-request";
49
+ readonly SnippetRequestTitle: "stldocs-snippet-request-title";
50
+ readonly SnippetRequestTitleContent: "stldocs-snippet-request-title-content";
51
+ readonly SnippetRequestTitleLabel: "stldocs-snippet-request-title-label";
52
+ readonly SnippetRequestTitleLanguage: "stldocs-snippet-request-title-language";
53
+ readonly SnippetRequestTitleMethod: "stldocs-snippet-request-title-method";
54
+ readonly SnippetResponse: "stldocs-snippet-response";
55
+ readonly SnippetMultiResponse: "stldocs-snippet-multi-response";
56
+ readonly SnippetResponseTitle: "stldocs-snippet-response-title";
57
+ readonly SnippetResponseClosed: "stldocs-snippet-response-closed";
58
+ readonly SnippetResponseOpen: "stldocs-snippet-response-opened";
59
+ readonly SnippetResponseTab: "stldocs-snippet-response-tab";
60
+ readonly SnippetResponseTabItem: "stldocs-snippet-response-tab-item";
61
+ readonly SnippetResponseTabItemActive: "stldocs-snippet-response-tab-item-active";
62
+ readonly SnippetResponseTabSingleReturn: "stldocs-snippet-response-tab-single-return";
63
+ readonly SnippetResponsePane: "stldocs-snippet-response-pane";
64
+ readonly SnippetResponsePaneActive: "stldocs-snippet-response-pane-active";
65
+ readonly Method: "stldocs-method";
66
+ readonly MethodHeader: "stldocs-method-header";
67
+ readonly MethodBody: "stldocs-method-body";
68
+ readonly MethodInfo: "stldocs-method-info";
69
+ readonly MethodInfoSection: "stldocs-method-info-section";
70
+ readonly MethodExample: "stldocs-method-example";
71
+ readonly MethodResponseColumn: "stldocs-method-response-column";
72
+ readonly MethodTitle: "stldocs-method-title";
73
+ readonly MethodBadges: "stldocs-method-badges";
74
+ readonly MethodSignature: "stldocs-method-signature";
75
+ readonly MethodDescription: "stldocs-method-description";
76
+ readonly MethodParameters: "stldocs-method-parameters";
77
+ readonly MethodReturns: "stldocs-method-returns";
78
+ readonly MethodContent: "stldocs-method-content";
79
+ readonly MethodContentColumn: "stldocs-method-content-column";
80
+ readonly MethodRouteHttpMethod: "stldocs-method-route-httpmethod";
81
+ readonly MethodRouteHttpMethodIconOnly: "stldocs-method-route-httpmethod-icon-only";
82
+ readonly MethodRouteEndpoint: "stldocs-method-route-endpoint";
83
+ readonly MethodRoute: "stldocs-method-route";
84
+ readonly MethodSummary: "stldocs-method-summary";
85
+ readonly MethodSinglePane: "stldocs-method-single-pane";
86
+ readonly MethodDoublePane: "stldocs-method-double-pane";
87
+ readonly SignatureTitle: "stldocs-signature-title";
88
+ readonly SignatureName: "stldocs-signature-name";
89
+ readonly SignatureQualified: "stldocs-signature-qualified";
90
+ readonly SignatureParams: "stldoc-signature-params";
91
+ readonly SignatureParen: "stldocs-signature-paren";
92
+ readonly SignatureReturns: "stldocs-signature-returns";
93
+ readonly Property: "stldocs-property";
94
+ readonly Properties: "stldocs-properties";
95
+ readonly PropertyHeader: "stldocs-property-header";
96
+ readonly PropertyInfo: "stldocs-property-info";
97
+ readonly PropertyDeclaration: "stldocs-property-declaration";
98
+ readonly PropertyDeprecated: "stldocs-property-deprecated";
99
+ readonly PropertyDeprecatedMessage: "stldocs-property-deprecated-message";
100
+ readonly PropertyContent: "stldocs-property-content";
101
+ readonly PropertyChildren: "stldocs-property-children";
102
+ readonly PropertyConstraints: "stldocs-property-constraints";
103
+ readonly PropertyConstraint: "stldocs-property-constraint";
104
+ readonly PropertyConstraintName: "stldocs-property-constraint-name";
105
+ readonly PropertyConstraintValue: "stldocs-property-constraint-value";
106
+ readonly PropertyDefault: "stldocs-property-default";
107
+ readonly PropertyDescription: "stldocs-property-description";
108
+ readonly PropertyAnnotation: "stldocs-property-annotation";
109
+ readonly PropertyName: "stldocs-property-name";
110
+ readonly PropertyBadges: "stldocs-property-badges";
111
+ readonly PropertyTypeName: "stldocs-property-typename";
112
+ readonly PropertyType: "stldocs-property-type";
113
+ readonly Overview: "stldocs-overview";
114
+ readonly OverviewHeader: "stldocs-overview-header";
115
+ readonly OverviewHeaderInfo: "stldocs-overview-header-info";
116
+ readonly OverviewHeaderInfoTimestamp: "stldocs-overview-header-info-timestamp";
117
+ readonly Resource: "stldocs-resource";
118
+ readonly ResourceContent: "stldocs-resource-content";
119
+ readonly ResourceContentProperties: "stldocs-resource-content-properties";
120
+ readonly ResourceContentGroup: "stldocs-resource-content-group";
121
+ readonly ResourceContentGroupName: "stldocs-resource-content-group-name";
122
+ readonly ResourceContentGroupModelTitle: "stldocs-resource-content-group-model-title";
123
+ readonly ResourceHeader: "stldocs-resource-header";
124
+ readonly ResourceTitle: "stldocs-resource-title";
125
+ readonly ResourceTitleSegment: "stldocs-resource-title-segment";
126
+ readonly ResourceDescription: "stldocs-resource-description";
127
+ readonly ResourceName: "stldocs-resource-name";
128
+ readonly Model: "stldocs-model";
129
+ readonly Root: "stldocs-root";
130
+ readonly Sidebar: "stldocs-sidebar";
131
+ readonly SidebarResource: "stldocs-sidebar-resource";
132
+ readonly SidebarResourceTitle: "stldocs-sidebar-resource-title";
133
+ readonly SidebarMethod: "stldocs-sidebar-method";
134
+ readonly SidebarItemTitle: "stldocs-sidebar-resource-title";
135
+ readonly SidebarExpander: "stldocs-sidebar-expander";
136
+ readonly SidebarExpanderSummary: "stldocs-sidebar-expander-summary";
137
+ readonly SidebarExpanderContent: "stldocs-sidebar-expander-content";
138
+ readonly SearchForm: "stldocs-search-form";
139
+ readonly SearchModal: "stldocs-search-modal";
140
+ readonly SearchFilter: "stldocs-search-filter";
141
+ readonly SearchFilterCount: "stldocs-search-filter-count";
142
+ readonly SearchBreadcrumb: "stldocs-search-breadcrumb";
143
+ readonly SearchBreadcrumbItem: "stldocs-search-breadcrumb-item";
144
+ readonly SearchBreadcrumbDivider: "stldocs-search-breadcrumb-divider";
145
+ readonly SearchResult: "stldocs-search-result";
146
+ readonly SearchResultResourceInfo: "stldocs-search-result-resource-info";
147
+ readonly SearchResultResourceTitle: "stldocs-search-result-resource-title";
148
+ readonly SearchResultResourcePath: "stldocs-search-result-resource-path";
149
+ readonly SearchResultGuideTitle: "stldocs-search-result-guide-title";
150
+ readonly SearchResultGuideExcerpt: "stldocs-search-result-guide-excerpt";
151
+ readonly Chat: "stldocs-chat";
152
+ readonly ChatHeader: "stldocs-chat-header";
153
+ readonly ChatInput: "stldocs-chat-input";
154
+ readonly ChatInputButtons: "stldocs-chat-input-buttons";
155
+ readonly ChatMessages: "stldocs-chat-messages";
156
+ readonly ChatMessage: "stldocs-chat-message";
157
+ readonly LanguageBlock: "stldocs-language-block";
158
+ readonly LanguageBlockContent: "stldocs-language-block-content";
159
+ readonly LanguageBlockContentIcon: "stldocs-language-block-content-icon";
160
+ readonly LanguageBlockContentInfo: "stldocs-language-block-content-info";
161
+ readonly LanguageBlockContentInfoLanguage: "stldocs-language-block-content-info-language";
162
+ readonly LanguageBlockContentInfoVersion: "stldocs-language-block-content-info-version";
163
+ readonly LanguageBlockLinks: "stldocs-language-block-links";
164
+ readonly LanguageBlockInstall: "stldocs-language-block-install";
165
+ readonly Breadcrumbs: "stldocs-breadcrumbs";
166
+ readonly BreadcrumbsItem: "stldocs-breadcrumbs-item";
167
+ readonly BreadcrumbsLink: "stldocs-breadcrumbs-link";
168
+ readonly BreadcrumbsNonLink: "stldocs-breadcrumbs-non-link";
169
+ readonly Dropdown: "stldocs-dropdown";
170
+ readonly DropdownTrigger: "stldocs-dropdown-trigger";
171
+ readonly DropdownTriggerContent: "stldocs-dropdown-trigger-content";
172
+ readonly DropdownChevron: "stldocs-dropdown-chevron";
173
+ readonly DropdownMenu: "stldocs-dropdown-menu";
174
+ readonly DropdownItem: "stldocs-dropdown-item";
175
+ readonly DropdownItemLink: "stldocs-dropdown-item-link";
176
+ readonly Button: "stldocs-button";
177
+ readonly ButtonSecondary: "stldocs-button-secondary";
178
+ readonly ButtonIcon: "stldocs-button-icon";
179
+ };
180
+ //#endregion
181
+ export { _default as t };