@scalar/api-client 0.9.2 → 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 +7 -0
- package/dist/index.js +14 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
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,
|
|
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
|
|
92
|
-
(
|
|
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,7 +13,7 @@
|
|
|
13
13
|
"rest",
|
|
14
14
|
"testing"
|
|
15
15
|
],
|
|
16
|
-
"version": "0.9.
|
|
16
|
+
"version": "0.9.3",
|
|
17
17
|
"engines": {
|
|
18
18
|
"node": ">=18"
|
|
19
19
|
},
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"vue": "^3.3.0",
|
|
46
46
|
"@scalar/themes": "0.5.4",
|
|
47
47
|
"@scalar/use-codemirror": "0.7.19",
|
|
48
|
-
"@scalar/use-
|
|
49
|
-
"@scalar/use-
|
|
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.
|
|
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",
|