@contentful/field-editor-shared 4.4.2-canary.5 → 4.5.1-canary.2
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/cjs/isLoadingStatus.js +13 -0
- package/dist/cjs/isLoadingStatus.test.js +24 -0
- package/dist/cjs/react-query.js +4 -0
- package/dist/esm/isLoadingStatus.js +3 -0
- package/dist/esm/isLoadingStatus.test.js +20 -0
- package/dist/esm/react-query.js +1 -0
- package/dist/types/isLoadingStatus.d.ts +1 -0
- package/dist/types/isLoadingStatus.test.d.ts +1 -0
- package/dist/types/react-query.d.ts +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "isLoadingStatus", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return isLoadingStatus;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function isLoadingStatus(status) {
|
|
12
|
+
return status === 'loading' || status === 'idle' || status === 'pending';
|
|
13
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _vitest = require("vitest");
|
|
6
|
+
const _isLoadingStatus = require("./isLoadingStatus");
|
|
7
|
+
(0, _vitest.describe)('isLoadingStatus', ()=>{
|
|
8
|
+
_vitest.test.each([
|
|
9
|
+
'loading',
|
|
10
|
+
'idle',
|
|
11
|
+
'pending'
|
|
12
|
+
])('returns true for %s', (status)=>{
|
|
13
|
+
(0, _vitest.expect)((0, _isLoadingStatus.isLoadingStatus)(status)).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
_vitest.test.each([
|
|
16
|
+
'success',
|
|
17
|
+
'error'
|
|
18
|
+
])('returns false for %s', (status)=>{
|
|
19
|
+
(0, _vitest.expect)((0, _isLoadingStatus.isLoadingStatus)(status)).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
(0, _vitest.test)('returns false for undefined', ()=>{
|
|
22
|
+
(0, _vitest.expect)((0, _isLoadingStatus.isLoadingStatus)(undefined)).toBe(false);
|
|
23
|
+
});
|
|
24
|
+
});
|
package/dist/cjs/react-query.js
CHANGED
|
@@ -12,6 +12,9 @@ _export(exports, {
|
|
|
12
12
|
SharedQueryClientProvider: function() {
|
|
13
13
|
return _queryClient.SharedQueryClientProvider;
|
|
14
14
|
},
|
|
15
|
+
isLoadingStatus: function() {
|
|
16
|
+
return _isLoadingStatus.isLoadingStatus;
|
|
17
|
+
},
|
|
15
18
|
useQuery: function() {
|
|
16
19
|
return _queryClient.useQuery;
|
|
17
20
|
},
|
|
@@ -21,6 +24,7 @@ _export(exports, {
|
|
|
21
24
|
});
|
|
22
25
|
const _queryClient = require("./queryClient");
|
|
23
26
|
_export_star(require("./hooks/useContentTypes"), exports);
|
|
27
|
+
const _isLoadingStatus = require("./isLoadingStatus");
|
|
24
28
|
function _export_star(from, to) {
|
|
25
29
|
Object.keys(from).forEach(function(k) {
|
|
26
30
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { isLoadingStatus } from './isLoadingStatus';
|
|
3
|
+
describe('isLoadingStatus', ()=>{
|
|
4
|
+
test.each([
|
|
5
|
+
'loading',
|
|
6
|
+
'idle',
|
|
7
|
+
'pending'
|
|
8
|
+
])('returns true for %s', (status)=>{
|
|
9
|
+
expect(isLoadingStatus(status)).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
test.each([
|
|
12
|
+
'success',
|
|
13
|
+
'error'
|
|
14
|
+
])('returns false for %s', (status)=>{
|
|
15
|
+
expect(isLoadingStatus(status)).toBe(false);
|
|
16
|
+
});
|
|
17
|
+
test('returns false for undefined', ()=>{
|
|
18
|
+
expect(isLoadingStatus(undefined)).toBe(false);
|
|
19
|
+
});
|
|
20
|
+
});
|
package/dist/esm/react-query.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isLoadingStatus(status: string | undefined): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-shared",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.1-canary.2+060cdf6a",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@contentful/app-sdk": "^4.42.0",
|
|
46
|
-
"@contentful/field-editor-test-utils": "^3.1.2
|
|
46
|
+
"@contentful/field-editor-test-utils": "^3.1.2",
|
|
47
47
|
"@lingui/core": "5.3.0",
|
|
48
48
|
"@tanstack/react-query": "^4.3.9",
|
|
49
49
|
"@testing-library/react": "16.3.0"
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"registry": "https://npm.pkg.github.com/"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "060cdf6a8238b1e17edb97c387686eed72ae7141"
|
|
77
77
|
}
|