@stainless-api/docs 0.1.0-beta.110 → 0.1.0-beta.111

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,17 @@
1
1
  # @stainless-api/docs
2
2
 
3
+ ## 0.1.0-beta.111
4
+
5
+ ### Patch Changes
6
+
7
+ - 6cab196: prevent summary elements from toggling when users are selecting text
8
+ - Updated dependencies [134885b]
9
+ - Updated dependencies [5ba9135]
10
+ - Updated dependencies [df0c958]
11
+ - Updated dependencies [e641d33]
12
+ - @stainless-api/docs-ui@0.1.0-beta.81
13
+ - @stainless-api/docs-search@0.1.0-beta.34
14
+
3
15
  ## 0.1.0-beta.110
4
16
 
5
17
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stainless-api/docs",
3
- "version": "0.1.0-beta.110",
3
+ "version": "0.1.0-beta.111",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -56,8 +56,8 @@
56
56
  "vite-plugin-prebundle-workers": "^0.2.0",
57
57
  "web-worker": "^1.5.0",
58
58
  "yaml": "^2.8.2",
59
- "@stainless-api/docs-search": "0.1.0-beta.33",
60
- "@stainless-api/docs-ui": "0.1.0-beta.80",
59
+ "@stainless-api/docs-search": "0.1.0-beta.34",
60
+ "@stainless-api/docs-ui": "0.1.0-beta.81",
61
61
  "@stainless-api/ui-primitives": "0.1.0-beta.49"
62
62
  },
63
63
  "devDependencies": {
@@ -0,0 +1,29 @@
1
+ // Let users select text in <summary> elements without toggling them
2
+
3
+ document.addEventListener(
4
+ 'mousedown',
5
+ (e) => {
6
+ const summary = (e.target as HTMLElement).closest('summary.stldocs-expander-summary');
7
+ if (!summary) return;
8
+ const selectionOnDown = window.getSelection()?.toString() ?? '';
9
+
10
+ document.addEventListener(
11
+ 'mouseup',
12
+ () => {
13
+ const selectionOnUp = window.getSelection()?.toString() ?? '';
14
+
15
+ if (selectionOnUp && selectionOnUp !== selectionOnDown) {
16
+ summary.addEventListener(
17
+ 'click',
18
+ (e) => {
19
+ e.preventDefault();
20
+ },
21
+ { once: true },
22
+ );
23
+ }
24
+ },
25
+ { once: true },
26
+ );
27
+ },
28
+ { capture: true },
29
+ );
@@ -120,3 +120,4 @@ if (props.kind === 'http_method' && props.stainlessPath) {
120
120
  <script src="../globalJs/tooltip.ts"></script>
121
121
  <script src="../globalJs/code-snippets.ts"></script>
122
122
  <script src="../globalJs/method-descriptions.ts"></script>
123
+ <script src="../globalJs/summary-selection-tweak.ts"></script>