@witchcraft/spellcraft 0.0.2 → 0.0.4
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/module.json +1 -1
- package/dist/module.mjs +1 -6
- package/dist/runtime/composables/useLabeledByKeyboardLayoutMap.d.ts +2 -2
- package/dist/runtime/composables/useShortcutManagerContextCount.d.ts +2 -2
- package/dist/runtime/composables/useShortcutManagerKeysLayout.d.ts +1 -1
- package/dist/runtime/composables/useShortcutManagerVirtualPress.d.ts +1 -1
- package/dist/runtime/utils/shortcutToId.d.ts +3 -3
- package/package.json +154 -155
- package/src/module.ts +1 -3
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { createResolver, defineNuxtModule, addTypeTemplate, addImportsDir } from '@nuxt/kit';
|
|
2
2
|
|
|
3
|
-
const dependencies = {
|
|
4
|
-
"@witchcraft/ui": "^0.3.0"};
|
|
5
|
-
const pkg = {
|
|
6
|
-
dependencies: dependencies};
|
|
7
|
-
|
|
8
3
|
const { resolve } = createResolver(import.meta.url);
|
|
9
4
|
const module = defineNuxtModule({
|
|
10
5
|
meta: {
|
|
@@ -14,7 +9,7 @@ const module = defineNuxtModule({
|
|
|
14
9
|
defaults: {},
|
|
15
10
|
moduleDependencies: {
|
|
16
11
|
"@witchcraft/ui/nuxt": {
|
|
17
|
-
version:
|
|
12
|
+
version: "^0.3.6"
|
|
18
13
|
}
|
|
19
14
|
},
|
|
20
15
|
async setup(_options, nuxt) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Ref } from "vue";
|
|
2
|
-
import { labelWithKeyboardMap } from "../../helpers/labelWithKeyboardMap.js
|
|
3
|
-
import type { Manager } from "../../types/manager.js
|
|
2
|
+
import { labelWithKeyboardMap } from "../../helpers/labelWithKeyboardMap.js";
|
|
3
|
+
import type { Manager } from "../../types/manager.js";
|
|
4
4
|
/**
|
|
5
5
|
* Sets up {@link getKeyboardLayoutMap} and {@link onKeyboardLayoutChange} to use {@link labelWithKeyboardMap}.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComputedRef, type Ref } from "vue";
|
|
2
|
-
import type { Manager } from "../../types/manager.js
|
|
3
|
-
import type { ContextInfo } from "../types.js
|
|
2
|
+
import type { Manager } from "../../types/manager.js";
|
|
3
|
+
import type { ContextInfo } from "../types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Updates the count of the ctx variables depending on how many shortcuts are using the variable. Requires shortcuts use the expressit library to set the ast property of conditions.
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Ref } from "vue";
|
|
2
|
-
import type { Keys } from "../../types/keys.js
|
|
2
|
+
import type { Keys } from "../../types/keys.js";
|
|
3
3
|
/**
|
|
4
4
|
* Watches Keys.layout.x/y and listens to resize changes on the element containing the keys to update what the pixel height of the element should be and what the pixel keyWidth.
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Ref } from "vue";
|
|
2
|
-
import type { ManagerListener } from "../../types/index.js
|
|
2
|
+
import type { ManagerListener } from "../../types/index.js";
|
|
3
3
|
export declare function useShortcutManagerVirtualPress(): {
|
|
4
4
|
virtuallyPressedKeys: Ref<Record<string, boolean>>;
|
|
5
5
|
updateVirtuallyPressed: ManagerListener;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PickManager } from "../../types/general.js
|
|
2
|
-
import type { Manager } from "../../types/manager.js
|
|
3
|
-
import type { Shortcut } from "../../types/shortcuts.js
|
|
1
|
+
import type { PickManager } from "../../types/general.js";
|
|
2
|
+
import type { Manager } from "../../types/manager.js";
|
|
3
|
+
import type { Shortcut } from "../../types/shortcuts.js";
|
|
4
4
|
/** Turns a shortcut into an id to use in a v-for loop. */
|
|
5
5
|
export declare const shortcutToId: (shortcut: Shortcut, manager: PickManager<"options", "stringifier"> & Pick<Manager, "keys">) => string;
|
package/package.json
CHANGED
|
@@ -1,156 +1,155 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
2
|
+
"name": "@witchcraft/spellcraft",
|
|
3
|
+
"description": "A shortcut manager library for handling ALL the shortcut needs of an application.",
|
|
4
|
+
"version": "0.0.4",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/core/index.js",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"build": {
|
|
9
|
+
"failOnWarn": false
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/core/index.d.ts",
|
|
14
|
+
"import": "./dist/core/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./utils": {
|
|
17
|
+
"types": "./dist/utils/index.d.ts",
|
|
18
|
+
"import": "./dist/utils/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./helpers": {
|
|
21
|
+
"types": "./dist/helpers/index.d.ts",
|
|
22
|
+
"import": "./dist/helpers/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./types": {
|
|
25
|
+
"types": "./dist/types/index.d.ts",
|
|
26
|
+
"import": "./dist/types/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./core": {
|
|
29
|
+
"types": "./dist/core/index.d.ts",
|
|
30
|
+
"import": "./dist/core/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./nuxt": {
|
|
33
|
+
"types": "./dist/types.d.mts",
|
|
34
|
+
"import": "./dist/module.mjs"
|
|
35
|
+
},
|
|
36
|
+
"./*": {
|
|
37
|
+
"types": "./dist/*.js",
|
|
38
|
+
"import": "./dist/*.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@witchcraft/expressit": "^0.4.1",
|
|
43
|
+
"@witchcraft/ui": "^0.3.7"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"@witchcraft/ui": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
49
|
+
"@witchcraft/expressit": {
|
|
50
|
+
"optional": true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@alanscodelog/utils": "^6.0.2",
|
|
55
|
+
"@witchcraft/expressit": "^0.4.1",
|
|
56
|
+
"@witchcraft/ui": "^0.3.7",
|
|
57
|
+
"vue": "^3.5.21"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@alanscodelog/commitlint-config": "^3.1.2",
|
|
61
|
+
"@alanscodelog/eslint-config": "^6.3.1",
|
|
62
|
+
"@alanscodelog/semantic-release-config": "^6.0.0",
|
|
63
|
+
"@alanscodelog/tsconfigs": "^6.2.0",
|
|
64
|
+
"@alanscodelog/vite-config": "^0.0.6",
|
|
65
|
+
"@commitlint/cli": "^19.8.1",
|
|
66
|
+
"@iconify/json": "^2.2.385",
|
|
67
|
+
"@nuxt/eslint-config": "^1.9.0",
|
|
68
|
+
"@nuxt/kit": "^4.1.2",
|
|
69
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
70
|
+
"@nuxt/schema": "^4.1.2",
|
|
71
|
+
"@nuxt/types": "^2.18.1",
|
|
72
|
+
"@types/node": "^24.5.2",
|
|
73
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
74
|
+
"@vitest/coverage-c8": "^0.33.0",
|
|
75
|
+
"concurrently": "^9.2.1",
|
|
76
|
+
"cross-env": "^10.0.0",
|
|
77
|
+
"defu": "^6.1.4",
|
|
78
|
+
"fast-glob": "^3.3.3",
|
|
79
|
+
"http-server": "^14.1.1",
|
|
80
|
+
"husky": "^9.1.7",
|
|
81
|
+
"indexit": "2.1.0-beta.3",
|
|
82
|
+
"madge": "^8.0.0",
|
|
83
|
+
"nuxt": "^4.1.2",
|
|
84
|
+
"onchange": "^7.1.0",
|
|
85
|
+
"semantic-release": "^24.2.8",
|
|
86
|
+
"tailwindcss": "^4.1.13",
|
|
87
|
+
"typedoc": "0.28.13",
|
|
88
|
+
"typescript": "^5.9.2",
|
|
89
|
+
"unbuild": "^3.6.1",
|
|
90
|
+
"unplugin-icons": "^22.3.0",
|
|
91
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
92
|
+
"vitest": "^3.2.4",
|
|
93
|
+
"vue-tsc": "^3.0.7"
|
|
94
|
+
},
|
|
95
|
+
"author": "Alan <alanscodelog@gmail.com>",
|
|
96
|
+
"repository": "https://github.com/witchcraftjs/spellcraft",
|
|
97
|
+
"license": "MIT",
|
|
98
|
+
"files": [
|
|
99
|
+
"src",
|
|
100
|
+
"dist"
|
|
101
|
+
],
|
|
102
|
+
"release": {
|
|
103
|
+
"extends": [
|
|
104
|
+
"@alanscodelog/semantic-release-config"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"commitlint": {
|
|
108
|
+
"extends": [
|
|
109
|
+
"@alanscodelog"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"babel": {
|
|
113
|
+
"presets": [
|
|
114
|
+
"@alanscodelog"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
"madge": {
|
|
118
|
+
"detectiveOptions": {
|
|
119
|
+
"ts": {
|
|
120
|
+
"skipTypeImports": true
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"browserslist": "> 0.5%, last 2 versions, not dead, not < 0.25%, not IE > 0, maintained node versions",
|
|
125
|
+
"engines": {
|
|
126
|
+
"node": ">=20.0.0"
|
|
127
|
+
},
|
|
128
|
+
"publishConfig": {
|
|
129
|
+
"access": "public"
|
|
130
|
+
},
|
|
131
|
+
"scripts": {
|
|
132
|
+
"build": "nuxt-module-build prepare && nuxt-module-build build && nuxi generate playground",
|
|
133
|
+
"build:only": "nuxt-module-build build",
|
|
134
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
135
|
+
"dev:playground": "nuxi dev playground",
|
|
136
|
+
"dev": "nuxi dev playground",
|
|
137
|
+
"test": "pnpm lint:types && vitest run --exclude '.direnv/**/*'",
|
|
138
|
+
"test:watch": "vitest --watch --exclude '.direnv/**/*'",
|
|
139
|
+
"test:inspect-errors": "cross-env INSPECT_ERRORS=true npm run test",
|
|
140
|
+
"coverage": "vitest --exclude '.direnv/**/*' --coverage",
|
|
141
|
+
"coverage:dev": "vitest --exclude '.direnv/**/*' --watch --coverage",
|
|
142
|
+
"doc": "typedoc",
|
|
143
|
+
"doc:watch": "onchange -i \"src/**/*.ts\" \"typedoc.config.js\" -- pnpm doc",
|
|
144
|
+
"doc:serve": "http-server docs --port=5001",
|
|
145
|
+
"doc:dev": "concurrently \"pnpm doc:watch\" \"pnpm doc:serve\"",
|
|
146
|
+
"doc:check-invalid": "typedoc --listInvalidSymbolLinks",
|
|
147
|
+
"lint:eslint": "eslint \"{src,test,playground/app}/**/*.{js,ts,vue,cjs}\" \"*.{js,ts}\" --max-warnings=0 --report-unused-disable-directives",
|
|
148
|
+
"lint:types": "vue-tsc --noEmit && echo 'todo cd playground && vue-tsc --noEmit'",
|
|
149
|
+
"lint:commits": "commitlint --from-last-tag --to HEAD --verbose",
|
|
150
|
+
"lint:imports": "madge --circular --extensions ts ./src",
|
|
151
|
+
"lint": "pnpm lint:types && pnpm lint:eslint && pnpm lint:commits && pnpm lint:imports",
|
|
152
|
+
"actions:debug": "act -r -v",
|
|
153
|
+
"gen:exports": "indexit update -o '${path}.js'"
|
|
154
|
+
}
|
|
155
|
+
}
|
package/src/module.ts
CHANGED
|
@@ -5,8 +5,6 @@ import {
|
|
|
5
5
|
defineNuxtModule
|
|
6
6
|
} from "@nuxt/kit"
|
|
7
7
|
|
|
8
|
-
import pkg from "../package.json" with { type: "json" }
|
|
9
|
-
|
|
10
8
|
|
|
11
9
|
const { resolve } = createResolver(import.meta.url)
|
|
12
10
|
|
|
@@ -30,7 +28,7 @@ export default defineNuxtModule<ModuleOptions>({
|
|
|
30
28
|
},
|
|
31
29
|
moduleDependencies: {
|
|
32
30
|
"@witchcraft/ui/nuxt": {
|
|
33
|
-
version:
|
|
31
|
+
version: "^0.3.6"
|
|
34
32
|
}
|
|
35
33
|
},
|
|
36
34
|
async setup(_options, nuxt) {
|