@stainless-api/docs 0.1.0-beta.33 → 0.1.0-beta.35
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 +14 -0
- package/package.json +5 -5
- package/stl-docs/components/ThemeSelect.astro +30 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @stainless-api/docs
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.35
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [344761e]
|
|
8
|
+
- @stainless-api/ui-primitives@0.1.0-beta.21
|
|
9
|
+
- @stainless-api/docs-ui@0.1.0-beta.28
|
|
10
|
+
|
|
11
|
+
## 0.1.0-beta.34
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- f5173e9: fix: theme flickering
|
|
16
|
+
|
|
3
17
|
## 0.1.0-beta.33
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stainless-api/docs",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.35",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"remark-gfm": "^4.0.1",
|
|
52
52
|
"remark-stringify": "^11.0.0",
|
|
53
53
|
"unified": "^11.0.5",
|
|
54
|
-
"@stainless-api/
|
|
55
|
-
"@stainless-api/ui
|
|
54
|
+
"@stainless-api/ui-primitives": "0.1.0-beta.21",
|
|
55
|
+
"@stainless-api/docs-ui": "0.1.0-beta.28"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@astrojs/check": "^0.9.5",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"typescript": "5.9.3",
|
|
67
67
|
"vite": "^6.3.6",
|
|
68
68
|
"zod": "^4.0.0",
|
|
69
|
-
"@stainless/
|
|
70
|
-
"@stainless/
|
|
69
|
+
"@stainless/sdk-json": "^0.1.0-beta.0",
|
|
70
|
+
"@stainless/eslint-config": "0.1.0-beta.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"vendor-deps": "pnpm tsx scripts/vendor_deps.ts",
|
|
@@ -84,36 +84,36 @@ const options = [
|
|
|
84
84
|
window.didInitThemePickers = window.didInitThemePickers ?? false;
|
|
85
85
|
|
|
86
86
|
// Only run once.
|
|
87
|
-
if (window.didInitThemePickers)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
}
|
|
87
|
+
if (!window.didInitThemePickers) {
|
|
88
|
+
window.didInitThemePickers = true;
|
|
89
|
+
|
|
90
|
+
// The stored theme will be either 'auto', 'light', 'dark' or null.
|
|
91
|
+
const storedTheme = typeof localStorage !== 'undefined' && localStorage.getItem('starlight-theme');
|
|
92
|
+
|
|
93
|
+
// This theme is either 'light' or 'dark'. It's used for setting the data-theme attribute.
|
|
94
|
+
const theme =
|
|
95
|
+
!storedTheme || storedTheme === 'auto'
|
|
96
|
+
? window.matchMedia('(prefers-color-scheme: light)').matches
|
|
97
|
+
? 'light'
|
|
98
|
+
: 'dark'
|
|
99
|
+
: storedTheme;
|
|
100
|
+
|
|
101
|
+
document.documentElement.dataset.theme = theme === 'light' ? 'light' : 'dark';
|
|
102
|
+
|
|
103
|
+
const themeSelects = document.querySelectorAll('[data-theme-select]');
|
|
104
|
+
const selectedThemeValue = storedTheme || 'auto';
|
|
105
|
+
|
|
106
|
+
themeSelects.forEach((select) => {
|
|
107
|
+
const tmpl = select.querySelector(`[data-value="${selectedThemeValue}"] template`);
|
|
108
|
+
const selectedSlot = select.querySelector('[data-part="trigger-selected"]');
|
|
109
|
+
|
|
110
|
+
selectedSlot.innerHTML = '';
|
|
111
|
+
if (tmpl) {
|
|
112
|
+
selectedSlot.appendChild(tmpl.content.cloneNode(true));
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
117
|
</script>
|
|
118
118
|
|
|
119
119
|
<script>
|