@hkdigital/lib-core 0.4.14 → 0.4.15
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/auth/jwt/util.d.ts +0 -6
- package/dist/auth/jwt/util.js +3 -1
- package/dist/auth/jwt.d.ts +1 -0
- package/dist/auth/jwt.js +1 -1
- package/dist/constants/bases.d.ts +1 -0
- package/dist/constants/bases.js +1 -0
- package/dist/constants/http.d.ts +2 -0
- package/dist/constants/http.js +2 -0
- package/dist/constants/mime.d.ts +4 -0
- package/dist/constants/mime.js +4 -0
- package/dist/constants/regexp.d.ts +3 -0
- package/dist/constants/regexp.js +3 -0
- package/dist/constants/states/drag.d.ts +1 -1
- package/dist/constants/states/drag.js +1 -1
- package/dist/constants/states/submit.d.ts +1 -1
- package/dist/constants/states/submit.js +1 -1
- package/dist/constants/states.d.ts +4 -0
- package/dist/constants/states.js +4 -0
- package/dist/constants/time.d.ts +1 -0
- package/dist/constants/time.js +1 -0
- package/dist/network/http/errors.js +2 -2
- package/dist/network/http/index.js +2 -2
- package/dist/network/http/mocks.js +2 -2
- package/dist/network/loaders/audio/mocks.js +1 -1
- package/dist/network/loaders/image/mocks.js +1 -1
- package/dist/network/states/NetworkLoader.svelte.js +1 -1
- package/dist/network/states/mocks.js +1 -1
- package/dist/ui/components/drag-drop/Draggable.svelte +7 -7
- package/package.json +1 -1
- package/dist/constants/index.d.ts +0 -6
- package/dist/constants/index.js +0 -6
package/dist/auth/jwt/util.d.ts
CHANGED
|
@@ -36,9 +36,3 @@ export function sign(claims: import("./typedef.js").JwtPayload, secretOrPrivateK
|
|
|
36
36
|
* @returns {import('./typedef.js').JwtPayload} claims - The decoded JWT payload
|
|
37
37
|
*/
|
|
38
38
|
export function verify(token: string, secretOrPrivateKey: import("./typedef.js").Secret, options?: import("./typedef.js").VerifyOptions): import("./typedef.js").JwtPayload;
|
|
39
|
-
/**
|
|
40
|
-
* Casts jsonwebtoken library errors to internal error types
|
|
41
|
-
* @param {Error} error - The original jsonwebtoken error
|
|
42
|
-
* @returns {Error} - The corresponding internal error
|
|
43
|
-
*/
|
|
44
|
-
export function castJwtError(error: Error): Error;
|
package/dist/auth/jwt/util.js
CHANGED
|
@@ -124,12 +124,14 @@ export function verify( token, secretOrPrivateKey, options=VERIFY_OPTIONS )
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
// Internals
|
|
128
|
+
|
|
127
129
|
/**
|
|
128
130
|
* Casts jsonwebtoken library errors to internal error types
|
|
129
131
|
* @param {Error} error - The original jsonwebtoken error
|
|
130
132
|
* @returns {Error} - The corresponding internal error
|
|
131
133
|
*/
|
|
132
|
-
|
|
134
|
+
function castJwtError(error) {
|
|
133
135
|
if (error instanceof JwtTokenExpiredError) {
|
|
134
136
|
return new TokenExpiredError(error.message, error.expiredAt, error);
|
|
135
137
|
}
|
package/dist/auth/jwt.d.ts
CHANGED
package/dist/auth/jwt.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./bases/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './bases/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Draggable states
|
|
2
|
-
export const
|
|
2
|
+
export const DRAG_IDLE = 'idle'; // Not being dragged
|
|
3
3
|
export const DRAGGING = 'dragging'; // Currently being dragged
|
|
4
4
|
export const DRAG_PREVIEW = 'drag-preview'; // Mouse down, before drag
|
|
5
5
|
export const DROPPING = 'dropping'; // Just dropped, animating
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./time/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './time/index.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as expect from '../../util/expect.js';
|
|
2
2
|
import { DetailedError } from '../../generic/errors.js';
|
|
3
3
|
|
|
4
|
-
import { CONTENT_TYPE } from '../../constants/http
|
|
4
|
+
import { CONTENT_TYPE } from '../../constants/http.js';
|
|
5
5
|
|
|
6
|
-
import { APPLICATION_JSON, TEXT_PLAIN } from '../../constants/mime
|
|
6
|
+
import { APPLICATION_JSON, TEXT_PLAIN } from '../../constants/mime.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Try to get error information from the server error response
|
|
@@ -17,6 +17,6 @@ export * from './response.js';
|
|
|
17
17
|
export * from './http-request.js';
|
|
18
18
|
export * from './json-request.js';
|
|
19
19
|
|
|
20
|
-
// import { CONTENT_TYPE, METHOD_GET, METHOD_POST } from '../../constants/http
|
|
20
|
+
// import { CONTENT_TYPE, METHOD_GET, METHOD_POST } from '../../constants/http.js';
|
|
21
21
|
|
|
22
|
-
// import { APPLICATION_JSON } from '../../constants/mime
|
|
22
|
+
// import { APPLICATION_JSON } from '../../constants/mime.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CONTENT_TYPE, CONTENT_LENGTH } from '../../constants/http
|
|
1
|
+
import { CONTENT_TYPE, CONTENT_LENGTH } from '../../constants/http.js';
|
|
2
2
|
|
|
3
|
-
import { OCTET_STREAM } from '../../constants/mime
|
|
3
|
+
import { OCTET_STREAM } from '../../constants/mime.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Create a response value that can be used by a mocked fetch function
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { DragController } from './DragController.js';
|
|
7
7
|
import { onDestroy } from 'svelte';
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
DRAG_IDLE,
|
|
10
10
|
DRAGGING,
|
|
11
11
|
DRAG_PREVIEW,
|
|
12
12
|
DROPPING
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
let draggableElement;
|
|
92
92
|
|
|
93
93
|
let dragTimeout = null;
|
|
94
|
-
let currentState = $state(
|
|
94
|
+
let currentState = $state(DRAG_IDLE);
|
|
95
95
|
|
|
96
96
|
// Custom preview follower state
|
|
97
97
|
let showPreview = $state(false);
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
|
|
113
113
|
// Computed state object for CSS classes
|
|
114
114
|
let stateObject = $derived({
|
|
115
|
-
idle: currentState ===
|
|
115
|
+
idle: currentState === DRAG_IDLE,
|
|
116
116
|
dragging: currentState === DRAGGING,
|
|
117
117
|
'drag-preview': currentState === DRAG_PREVIEW,
|
|
118
118
|
dropping: currentState === DROPPING,
|
|
@@ -295,10 +295,10 @@
|
|
|
295
295
|
|
|
296
296
|
// Brief dropping state before returning to idle
|
|
297
297
|
setTimeout(() => {
|
|
298
|
-
currentState =
|
|
298
|
+
currentState = DRAG_IDLE;
|
|
299
299
|
}, 100);
|
|
300
300
|
} else {
|
|
301
|
-
currentState =
|
|
301
|
+
currentState = DRAG_IDLE;
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
onDragEnd?.({ event, item, wasDropped });
|
|
@@ -321,7 +321,7 @@
|
|
|
321
321
|
function handleMouseUp(event) {
|
|
322
322
|
if (dragTimeout) {
|
|
323
323
|
clearTimeout(dragTimeout);
|
|
324
|
-
currentState =
|
|
324
|
+
currentState = DRAG_IDLE;
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
|
|
@@ -456,7 +456,7 @@
|
|
|
456
456
|
|
|
457
457
|
// Clean up
|
|
458
458
|
touchDragging = false;
|
|
459
|
-
currentState =
|
|
459
|
+
currentState = DRAG_IDLE;
|
|
460
460
|
showPreview = false;
|
|
461
461
|
dragState.end(draggableId);
|
|
462
462
|
|
package/package.json
CHANGED
package/dist/constants/index.js
DELETED