@scalar/api-client 0.9.1 → 0.9.3

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,23 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 0.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [75e1cdf8]
8
+ - @scalar/use-keyboard-event@0.5.8
9
+
10
+ ## 0.9.2
11
+
12
+ ### Patch Changes
13
+
14
+ - 81543f42: chore: add support for Node 18
15
+ - Updated dependencies [81543f42]
16
+ - @scalar/use-keyboard-event@0.5.7
17
+ - @scalar/use-codemirror@0.7.19
18
+ - @scalar/use-modal@0.2.3
19
+ - @scalar/themes@0.5.4
20
+
3
21
  ## 0.9.1
4
22
 
5
23
  ### Patch Changes
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ var __publicField = (obj, key, value) => {
16
16
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
17
17
  return value;
18
18
  };
19
- import { defineComponent, openBlock, createBlock, resolveDynamicComponent, withCtx, createTextVNode, toDisplayString, unref, createCommentVNode, computed, onMounted, watch, reactive, readonly, ref, createElementBlock, toRaw, createElementVNode, createVNode, normalizeClass, normalizeStyle, renderSlot, Fragment, renderList, createStaticVNode, pushScopeId, popScopeId, withDirectives, withModifiers, vModelSelect, vModelText, vModelCheckbox, vShow, withKeys } from "vue";
19
+ import { defineComponent, openBlock, createBlock, resolveDynamicComponent, withCtx, createTextVNode, toDisplayString, unref, createCommentVNode, ref, onMounted, onActivated, onDeactivated, computed, watch, reactive, readonly, createElementBlock, toRaw, createElementVNode, createVNode, normalizeClass, normalizeStyle, renderSlot, Fragment, renderList, createStaticVNode, pushScopeId, popScopeId, withDirectives, withModifiers, vModelSelect, vModelText, vModelCheckbox, vShow, withKeys } from "vue";
20
20
  import { Dialog, DialogPanel, DialogTitle, DialogDescription, Disclosure, DisclosureButton, DisclosurePanel, TabGroup, TabList, Tab, TabPanels, TabPanel } from "@headlessui/vue";
21
21
  import { useMediaQuery } from "@vueuse/core";
22
22
  import TimeAgo from "javascript-time-ago";
@@ -71,6 +71,15 @@ const getThemeById = (themeId = "default") => {
71
71
  }
72
72
  return presets[themeId] ?? defaultTheme;
73
73
  };
74
+ function useActive() {
75
+ const isActive = ref(true);
76
+ onMounted(() => isActive.value = true);
77
+ onActivated(() => isActive.value = true);
78
+ onDeactivated(() => isActive.value = false);
79
+ return {
80
+ isActive: computed(() => isActive.value)
81
+ };
82
+ }
74
83
  function useKeyboardEvent({
75
84
  element,
76
85
  keyList,
@@ -83,13 +92,15 @@ function useKeyboardEvent({
83
92
  active = () => true
84
93
  }) {
85
94
  const targetEl = computed(() => (element == null ? void 0 : element.value) || "document");
95
+ const { isActive: componentIsActive } = useActive();
86
96
  const keys = keyList.map((k) => k.toLocaleLowerCase());
87
97
  const eventHandler = (event) => {
88
98
  const target = event.target;
89
99
  const isInput = ["INPUT", "TEXTAREA", "SELECT"].includes(target.tagName) || target.contentEditable;
90
100
  if (
91
- // Check for command or ctrl keys
92
- (withCtrlCmd ? event.ctrlKey || event.metaKey : !event.ctrlKey && !event.metaKey) && // Check for shift key
101
+ // Check if the component is active (e.g. in a `<keepalive>`)
102
+ (componentIsActive.value && // Check for command or ctrl keys
103
+ withCtrlCmd ? event.ctrlKey || event.metaKey : !event.ctrlKey && !event.metaKey) && // Check for shift key
93
104
  (withShift ? event.shiftKey : !event.shiftKey) && // Check for alt key
94
105
  (withAlt ? event.altKey : !event.altKey) && // Check whether or not to ignore inputs
95
106
  (!ignoreInputElements || !isInput) && // Check for key match
package/package.json CHANGED
@@ -13,9 +13,9 @@
13
13
  "rest",
14
14
  "testing"
15
15
  ],
16
- "version": "0.9.1",
16
+ "version": "0.9.3",
17
17
  "engines": {
18
- "node": ">=20"
18
+ "node": ">=18"
19
19
  },
20
20
  "type": "module",
21
21
  "main": "./dist/index.js",
@@ -43,22 +43,22 @@
43
43
  "pretty-bytes": "^6.1.1",
44
44
  "pretty-ms": "^8.0.0",
45
45
  "vue": "^3.3.0",
46
- "@scalar/use-codemirror": "0.7.18",
47
- "@scalar/themes": "0.5.3",
48
- "@scalar/use-keyboard-event": "0.5.6",
49
- "@scalar/use-modal": "0.2.2"
46
+ "@scalar/themes": "0.5.4",
47
+ "@scalar/use-codemirror": "0.7.19",
48
+ "@scalar/use-keyboard-event": "0.5.8",
49
+ "@scalar/use-modal": "0.2.3"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/content-type": "^1.1.6",
53
53
  "@vitejs/plugin-vue": "^4.4.0",
54
54
  "@vitest/coverage-v8": "^0.34.4",
55
55
  "tsc-alias": "^1.8.8",
56
- "vite": "^4.4.12",
56
+ "vite": "^4.5.2",
57
57
  "vite-plugin-css-injected-by-js": "^3.3.0",
58
58
  "vitest": "^0.34.4",
59
59
  "vue-tsc": "^1.8.19",
60
- "@scalar/api-client-proxy": "0.5.12",
61
- "@scalar/echo-server": "0.5.7"
60
+ "@scalar/api-client-proxy": "0.5.13",
61
+ "@scalar/echo-server": "0.5.8"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "vue": "^3.3.0"