@stonecrop/utilities 0.2.23 → 0.2.25
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/dist/composables/keyboard.js +464 -0
- package/dist/composables/visibility/index.js +47 -0
- package/dist/index.js +8 -0
- package/dist/src/composables/keyboard.d.ts +4 -0
- package/dist/src/composables/keyboard.d.ts.map +1 -0
- package/dist/src/composables/visibility/index.d.ts +23 -0
- package/dist/src/composables/visibility/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +10 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/types/index.js +0 -0
- package/dist/utilities/src/tsdoc-metadata.json +11 -0
- package/dist/utilities.d.ts +22 -0
- package/dist/utilities.js +222 -183
- package/dist/utilities.js.map +1 -1
- package/dist/utilities.tsbuildinfo +1 -0
- package/dist/utilities.umd.cjs +1 -1
- package/dist/utilities.umd.cjs.map +1 -1
- package/package.json +22 -23
- package/src/composables/keyboard.ts +1 -1
- package/src/index.ts +8 -3
- package/src/types/index.ts +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/utilities",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -17,35 +17,36 @@
|
|
|
17
17
|
},
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
-
"import":
|
|
20
|
+
"import": {
|
|
21
|
+
"types": "./dist/utilities/src/index.d.ts",
|
|
22
|
+
"default": "./dist/utilities.js"
|
|
23
|
+
},
|
|
21
24
|
"require": "./dist/utilities.umd.cjs"
|
|
22
25
|
}
|
|
23
26
|
},
|
|
24
|
-
"
|
|
25
|
-
"module": "dist/utilities.js",
|
|
26
|
-
"umd": "dist/utilities.umd.cjs",
|
|
27
|
-
"types": "src/index",
|
|
27
|
+
"typings": "./dist/utilities/src/index.d.ts",
|
|
28
28
|
"files": [
|
|
29
29
|
"dist/*",
|
|
30
30
|
"src/*"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"
|
|
33
|
+
"@vueuse/core": "^10.11.0",
|
|
34
|
+
"vue": "^3.4.31"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@typescript-eslint/
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"cypress": "^
|
|
37
|
+
"@microsoft/api-documenter": "^7.25.3",
|
|
38
|
+
"@rushstack/heft": "^0.66.18",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
40
|
+
"@typescript-eslint/parser": "^7.14.1",
|
|
41
|
+
"@vitejs/plugin-vue": "^5.0.5",
|
|
42
|
+
"cypress": "^13.11.0",
|
|
42
43
|
"eslint": "^8.40.0",
|
|
43
44
|
"eslint-config-prettier": "^8.8.0",
|
|
44
45
|
"eslint-plugin-vue": "^9.11.1",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
46
|
+
"typescript": "^5.5.2",
|
|
47
|
+
"vite": "^5.3.2",
|
|
48
|
+
"vue-router": "^4.4.0",
|
|
49
|
+
"stonecrop-rig": "0.2.22"
|
|
49
50
|
},
|
|
50
51
|
"publishConfig": {
|
|
51
52
|
"access": "public"
|
|
@@ -54,13 +55,11 @@
|
|
|
54
55
|
"node": ">=20.11.0"
|
|
55
56
|
},
|
|
56
57
|
"scripts": {
|
|
57
|
-
"prepublish": "
|
|
58
|
-
"build": "
|
|
58
|
+
"prepublish": "heft build && vite build && rushx docs",
|
|
59
|
+
"build": "heft build && vite build && rushx docs",
|
|
59
60
|
"dev": "vite",
|
|
61
|
+
"docs": "api-documenter markdown -i temp -o ../docs/utilities",
|
|
60
62
|
"lint": "eslint . --ext .ts,.vue",
|
|
61
|
-
"preview": "vite preview"
|
|
62
|
-
"story:build": "histoire build",
|
|
63
|
-
"story:dev": "histoire dev",
|
|
64
|
-
"story:preview": "histoire preview"
|
|
63
|
+
"preview": "vite preview"
|
|
65
64
|
}
|
|
66
65
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type WatchStopHandle, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
2
2
|
import { useFocusWithin } from '@vueuse/core'
|
|
3
3
|
|
|
4
|
-
import type { KeyboardNavigationOptions, KeypressHandlers } from 'types'
|
|
5
4
|
import { useElementVisibility } from '@/composables/visibility'
|
|
5
|
+
import type { KeyboardNavigationOptions, KeypressHandlers } from '@/types'
|
|
6
6
|
|
|
7
7
|
// helper functions
|
|
8
8
|
const isVisible = (element: HTMLElement) => {
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { App } from 'vue'
|
|
2
2
|
|
|
3
|
-
import { defaultKeypressHandlers, useKeyboardNav } from '
|
|
4
|
-
|
|
3
|
+
import { defaultKeypressHandlers, useKeyboardNav } from '@/composables/keyboard'
|
|
4
|
+
export type { KeypressHandlers, KeyboardNavigationOptions } from '@/types'
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Install all utility components
|
|
8
|
+
* @param app - Vue app instance
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
6
11
|
function install(app: App /* options */) {}
|
|
7
12
|
|
|
8
|
-
export {
|
|
13
|
+
export { defaultKeypressHandlers, install, useKeyboardNav }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentPublicInstance, Ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
export type KeypressHandlers = {
|
|
4
|
+
[key: string]: (ev: KeyboardEvent) => any
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type KeyboardNavigationOptions = {
|
|
8
|
+
parent?: string | HTMLElement | Ref<HTMLElement>
|
|
9
|
+
selectors?:
|
|
10
|
+
| string
|
|
11
|
+
| HTMLElement
|
|
12
|
+
| HTMLElement[]
|
|
13
|
+
| ComponentPublicInstance[]
|
|
14
|
+
| Ref<HTMLElement>
|
|
15
|
+
| Ref<HTMLElement[]>
|
|
16
|
+
| Ref<ComponentPublicInstance[]>
|
|
17
|
+
handlers?: KeypressHandlers
|
|
18
|
+
}
|