toolcraft-openapi 0.0.102 → 0.0.103

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.
@@ -18,7 +18,7 @@
18
18
  },
19
19
  {
20
20
  "name": "toolcraft-openapi",
21
- "version": "0.0.102",
21
+ "version": "0.0.103",
22
22
  "license": "MIT"
23
23
  }
24
24
  ]
@@ -77,9 +77,13 @@ function stepKey(state, key, runtimeHandles) {
77
77
  case "bottom":
78
78
  return setCursor(state, state.filtered.length - 1);
79
79
  case "pageUp":
80
- return moveCursor(state, -pageSize(state));
80
+ return isDetailBlobFocused(state)
81
+ ? detailScroll(state, -detailBodyHeight(state))
82
+ : moveCursor(state, -pageSize(state));
81
83
  case "pageDown":
82
- return moveCursor(state, pageSize(state));
84
+ return isDetailBlobFocused(state)
85
+ ? detailScroll(state, detailBodyHeight(state))
86
+ : moveCursor(state, pageSize(state));
83
87
  case "focusNext":
84
88
  return focusNext(state);
85
89
  case "escape":
@@ -328,8 +332,16 @@ function moveCursor(state, delta) {
328
332
  if (state.focused === "detail" && hasDetailCursor(state)) {
329
333
  return moveDetailCursor(state, delta);
330
334
  }
335
+ if (isDetailBlobFocused(state)) {
336
+ return detailScroll(state, delta);
337
+ }
331
338
  return setCursor(state, state.cursor + delta);
332
339
  }
340
+ function isDetailBlobFocused(state) {
341
+ return (state.focused === "detail" &&
342
+ !hasDetailCursor(state) &&
343
+ (state.detail.items?.length ?? 0) > 0);
344
+ }
333
345
  function moveDetailCursor(state, delta) {
334
346
  const max = Math.max(0, (state.detail.items?.length ?? 0) - 1);
335
347
  const cursor = clamp(state.detail.cursor + delta, 0, max);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft-openapi",
3
- "version": "0.0.102",
3
+ "version": "0.0.103",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -30,7 +30,7 @@
30
30
  "toolcraft-openapi-generate": "dist/bin/generate.js"
31
31
  },
32
32
  "dependencies": {
33
- "toolcraft": "0.0.102",
33
+ "toolcraft": "0.0.103",
34
34
  "auth-store": "^0.0.1",
35
35
  "fast-string-width": "^3.0.2",
36
36
  "fast-wrap-ansi": "^0.2.0",