@stainless-api/docs 0.1.0-beta.75 → 0.1.0-beta.77

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @stainless-api/docs
2
2
 
3
+ ## 0.1.0-beta.77
4
+
5
+ ### Patch Changes
6
+
7
+ - 5c8fef8: fixes pagefind path
8
+
9
+ ## 0.1.0-beta.76
10
+
11
+ ### Patch Changes
12
+
13
+ - 5a6d886: fix searchbar styles
14
+ - d79718a: should use base url when resolving pagefind
15
+
3
16
  ## 0.1.0-beta.75
4
17
 
5
18
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stainless-api/docs",
3
- "version": "0.1.0-beta.75",
3
+ "version": "0.1.0-beta.77",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -40,7 +40,7 @@
40
40
  "@astrojs/markdown-remark": "^6.3.10",
41
41
  "@astrojs/react": "^4.4.2",
42
42
  "@stainless-api/sdk": "0.1.0-alpha.19",
43
- "astro-expressive-code": "^0.41.3",
43
+ "astro-expressive-code": "^0.41.5",
44
44
  "cheerio": "^1.1.2",
45
45
  "clsx": "^2.1.1",
46
46
  "dotenv": "17.2.3",
@@ -65,7 +65,7 @@
65
65
  "devDependencies": {
66
66
  "@astrojs/check": "^0.9.6",
67
67
  "@markdoc/markdoc": "^0.5.4",
68
- "@types/node": "24.10.4",
68
+ "@types/node": "24.10.8",
69
69
  "@types/react": "19.2.7",
70
70
  "@types/react-dom": "^19.2.3",
71
71
  "react": "^19.2.3",
@@ -184,31 +184,6 @@ export function SnippetContainer({ children, signature }: SnippetContainerProps)
184
184
  );
185
185
  }
186
186
 
187
- export function CondensibleSnippetCode({
188
- content,
189
- language,
190
- signature,
191
- highlighted,
192
- }: SnippetCodeProps & { signature: string; highlighted: string; language: string }) {
193
- const ranges = getCollapsedRanges(content, language, signature);
194
- const html = condensedShikiHtmlFull(highlighted, language, ranges);
195
- const offset = getCounterOffset(ranges);
196
-
197
- return (
198
- <div
199
- className={clsx(style.SnippetCode, 'stl-snippet-code-is-collapsed')}
200
- data-snippet-expanded-offset={offset}
201
- >
202
- <pre className={style.SnippetCodeContent} data-stldocs-copy-content>
203
- <code
204
- className={language === 'json' ? 'snippet-json' : 'snippet'}
205
- dangerouslySetInnerHTML={{ __html: html }}
206
- />
207
- </pre>
208
- </div>
209
- );
210
- }
211
-
212
187
  export function SnippetButtons({ content }: { content: string }) {
213
188
  void content;
214
189
  const language = useLanguage();
@@ -226,6 +201,7 @@ export function SnippetButtons({ content }: { content: string }) {
226
201
  </>
227
202
  );
228
203
  }
204
+
229
205
  export function SnippetCode({ content, signature, language: forcedLanguage }: SnippetCodeProps) {
230
206
  const lang = useLanguage();
231
207
  const language = forcedLanguage || lang;
@@ -245,13 +221,8 @@ export function SnippetCode({ content, signature, language: forcedLanguage }: Sn
245
221
  <div
246
222
  className={clsx(style.SnippetCode, isCollapsible && 'stl-snippet-code-is-collapsed')}
247
223
  data-snippet-expanded-offset={offset}
248
- >
249
- <pre className={style.SnippetCodeContent} data-stldocs-copy-content>
250
- <code
251
- className={(language as string) === 'json' ? 'snippet-json' : 'snippet'}
252
- dangerouslySetInnerHTML={{ __html: highlighted }}
253
- />
254
- </pre>
255
- </div>
224
+ data-stldocs-copy-content
225
+ dangerouslySetInnerHTML={{ __html: highlighted }}
226
+ />
256
227
  );
257
228
  }
@@ -89,10 +89,14 @@ export function DocsSearch({ settings, currentPath }: { settings: SearchSettings
89
89
  const markdownRenderer = React.use(createMarkdownRenderer());
90
90
  const { stainlessPath, language } = parseRoute(BASE_PATH, currentPath);
91
91
  // eslint-disable-next-line turbo/no-undeclared-env-vars
92
- const pageFind = import.meta.env.DEV ? undefined : '/pagefind/pagefind.js';
92
+ const pageFind = import.meta.env.DEV
93
+ ? undefined
94
+ : `${import.meta.env.BASE_URL}/pagefind/pagefind.js`.replace(/\/+/g, '/');
93
95
 
94
- function handleSelect(path: string) {
95
- const url = path.startsWith('/') ? path : generateRoute(BASE_PATH, language, path);
96
+ function handleSelect(selectedPath: string) {
97
+ const url = selectedPath.startsWith('/')
98
+ ? selectedPath
99
+ : generateRoute(BASE_PATH, language, selectedPath);
96
100
  if (url) window.location.href = url;
97
101
  }
98
102
 
@@ -73,21 +73,10 @@ if (readme) {
73
73
  transformRequestSnippet={MIDDLEWARE.transformRequestSnippet}
74
74
  />
75
75
 
76
+ {/* TODO: we should not set inline styles here? */}
76
77
  <style
77
78
  is:inline
78
79
  set:text={`
79
- #stldocs-snippet-title {
80
- display: flex;
81
- gap: 5px;
82
- }
83
-
84
- .stldocs-snippet-code:not(.stldocs-snippet-response .stldocs-snippet-code) {
85
- padding: 0 !important;
86
-
87
- .astro-code {
88
- padding: 1rem;
89
- }
90
- }
91
80
 
92
81
  [data-has-sidebar]:not([data-has-toc]) .sl-container {
93
82
  max-width: 1428px;
@@ -110,21 +99,6 @@ if (readme) {
110
99
  vertical-align: text-bottom;
111
100
  }
112
101
 
113
- .sl-markdown-content .octicon {
114
- margin-right: 0.2rem;
115
- overflow: visible !important;
116
- -webkit-mask: var(--oct-icon) no-repeat;
117
- mask: var(--oct-icon) no-repeat;
118
- -webkit-mask-size: 100% 100%;
119
- mask-size: 100% 100%;
120
- background-color: currentColor;
121
- color: inherit;
122
- display: inline-block;
123
- vertical-align: text-bottom;
124
- width: 1em;
125
- height: 1em;
126
- }
127
-
128
102
  .sl-markdown-content code {
129
103
  white-space: pre-wrap;
130
104
  }
package/styles/code.css CHANGED
@@ -52,14 +52,16 @@
52
52
  }
53
53
 
54
54
  .stl-snippet-expand-button {
55
- display: none;
56
-
57
- position: relative;
55
+ position: absolute;
58
56
  left: 50%;
59
- transform: translateX(-50%);
60
- bottom: 12px;
57
+ transform: translateX(-50%) translateY(-50%);
61
58
  cursor: pointer;
62
59
  height: auto;
60
+ z-index: 100;
61
+
62
+ &:not(.stl-snippet-collapsible .stl-snippet-expand-button) {
63
+ display: none;
64
+ }
63
65
 
64
66
  &.stl-ui-button {
65
67
  background-color: var(--stl-color-background);
@@ -87,13 +89,6 @@
87
89
  }
88
90
 
89
91
  .stl-snippet-collapsible {
90
- .stl-snippet-expand-button {
91
- display: block;
92
- margin-bottom: -23px;
93
- /* Prevent clipping of the button with the container below */
94
- z-index: 100;
95
- }
96
-
97
92
  .stl-snippet-code-is-collapsed {
98
93
  .hidden {
99
94
  display: none;
package/styles/search.css CHANGED
@@ -60,6 +60,7 @@ site-search {
60
60
  width: 100%;
61
61
  max-width: 30rem;
62
62
  justify-content: start;
63
+ padding: var(--sl-button-padding-y) var(--sl-button-padding-x);
63
64
 
64
65
  > :last-child {
65
66
  margin-inline-start: auto;