svelte-command 1.1.50 → 2.0.0
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/LICENSE +1 -1
- package/README.md +4 -4
- package/package.json +25 -19
- package/src/CommandButton.svelte +3 -3
- package/src/confirm-command.mjs +1 -1
- package/src/fetch-command.mjs +8 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[](https://svelte.dev)
|
|
2
2
|
[](https://www.npmjs.com/package/svelte-command)
|
|
3
3
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
4
4
|
[](https://bundlejs.com/?q=svelte-command)
|
|
@@ -86,9 +86,9 @@ Command executing a fetch request.
|
|
|
86
86
|
|
|
87
87
|
### Parameters
|
|
88
88
|
|
|
89
|
-
* `url`
|
|
90
|
-
* `fetchOptions`
|
|
91
|
-
* `options`
|
|
89
|
+
* `url` **any** 
|
|
90
|
+
* `fetchOptions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
91
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
|
|
92
92
|
|
|
93
93
|
## handleFailedResponse
|
|
94
94
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-command",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
|
-
"access": "public"
|
|
5
|
+
"access": "public",
|
|
6
|
+
"provenance": true
|
|
6
7
|
},
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
@@ -25,38 +26,43 @@
|
|
|
25
26
|
],
|
|
26
27
|
"license": "BSD-2-Clause",
|
|
27
28
|
"scripts": {
|
|
28
|
-
"prepare": "vite
|
|
29
|
+
"prepare": "npm run prepare:vite",
|
|
30
|
+
"prepare:vite": "vite build",
|
|
29
31
|
"start": "vite",
|
|
30
32
|
"test": "npm run test:ava && npm run test:cafe",
|
|
31
33
|
"test:cafe": "testcafe $BROWSER:headless tests/cafe/*-cafe.mjs --esm -s build/test --page-request-timeout 5000 --app-init-delay 8000 --app vite",
|
|
32
|
-
"test:ava": "ava --timeout
|
|
34
|
+
"test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
|
|
33
35
|
"docs": "documentation readme --section=API ./src/**/*.mjs",
|
|
34
36
|
"lint": "npm run lint:docs",
|
|
35
37
|
"lint:docs": "documentation lint ./src/**/*.mjs",
|
|
36
38
|
"preview": "vite preview"
|
|
37
39
|
},
|
|
38
40
|
"devDependencies": {
|
|
39
|
-
"@semantic-release/commit-analyzer": "^
|
|
41
|
+
"@semantic-release/commit-analyzer": "^12.0.0",
|
|
40
42
|
"@semantic-release/exec": "^6.0.3",
|
|
41
|
-
"@semantic-release/
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"vite
|
|
43
|
+
"@semantic-release/github": "^10.0.4",
|
|
44
|
+
"@semantic-release/release-notes-generator": "^13.0.0",
|
|
45
|
+
"@sveltejs/vite-plugin-svelte": "^3.1.0",
|
|
46
|
+
"ava": "^6.1.3",
|
|
47
|
+
"documentation": "^14.0.3",
|
|
48
|
+
"mf-styling": "^3.1.6",
|
|
49
|
+
"npm-pkgbuild": "^15.3.14",
|
|
50
|
+
"semantic-release": "^23.1.1",
|
|
51
|
+
"svelte": "^5.0.0-next.136",
|
|
52
|
+
"testcafe": "^3.6.0",
|
|
53
|
+
"vite": "^5.2.11",
|
|
54
|
+
"vite-plugin-compression2": "^1.1.0"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"svelte": "^5.0.0-next.0"
|
|
52
58
|
},
|
|
53
59
|
"optionalDependencies": {
|
|
54
60
|
"mf-hosting-cloudflare": "^1.0.6",
|
|
55
|
-
"mf-hosting-frontend": "^
|
|
61
|
+
"mf-hosting-frontend": "^3.0.3"
|
|
56
62
|
},
|
|
57
63
|
"repository": {
|
|
58
64
|
"type": "git",
|
|
59
|
-
"url": "https://github.com/arlac77/svelte-command"
|
|
65
|
+
"url": "git+https://github.com/arlac77/svelte-command.git"
|
|
60
66
|
},
|
|
61
67
|
"bugs": {
|
|
62
68
|
"url": "https://github.com/arlac77/svelte-command/issues"
|
|
@@ -77,7 +83,7 @@
|
|
|
77
83
|
[
|
|
78
84
|
"@semantic-release/exec",
|
|
79
85
|
{
|
|
80
|
-
"publishCmd": "npx npm-pkgbuild --
|
|
86
|
+
"publishCmd": "npx npm-pkgbuild --publish dist"
|
|
81
87
|
}
|
|
82
88
|
],
|
|
83
89
|
[
|
package/src/CommandButton.svelte
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
export let command;
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
function onkeydown(event) {
|
|
5
5
|
if (command.matchesKeydown?.(event)) {
|
|
6
6
|
command.start();
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
|
-
<svelte:window
|
|
11
|
+
<svelte:window {onkeydown} />
|
|
12
12
|
|
|
13
13
|
<button
|
|
14
14
|
disabled={$command.disabled}
|
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
<slot />
|
|
24
24
|
|
|
25
25
|
{#if $command.active}
|
|
26
|
-
<div class="spinner"
|
|
26
|
+
<div class="spinner"></div>
|
|
27
27
|
{/if}
|
|
28
28
|
</button>
|
package/src/confirm-command.mjs
CHANGED
package/src/fetch-command.mjs
CHANGED
|
@@ -4,6 +4,14 @@ import { Command } from "./command.mjs";
|
|
|
4
4
|
* Command executing a fetch request.
|
|
5
5
|
*/
|
|
6
6
|
export class FetchCommand extends Command {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {*} url
|
|
11
|
+
* @param {Object} fetchOptions
|
|
12
|
+
* @param {Object} options
|
|
13
|
+
* @param {Function} [options.responseHandler]
|
|
14
|
+
*/
|
|
7
15
|
constructor(url, fetchOptions, options = {}) {
|
|
8
16
|
const controller = new AbortController();
|
|
9
17
|
super(
|