@uxf/cms 11.48.0 → 11.48.2
Sign up to get free protection for your applications and to get access to all the features.
package/api/index.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
"use strict";
|
2
|
+
var _a;
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
4
|
exports.dataGridAutocompleteGet = void 0;
|
4
5
|
exports.contentGet = contentGet;
|
@@ -19,10 +20,9 @@ exports.userConfigGetAll = userConfigGetAll;
|
|
19
20
|
exports.userConfigGet = userConfigGet;
|
20
21
|
exports.uploadFile = uploadFile;
|
21
22
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
22
|
-
const env_variables_1 = require("@uxf/example/src/config/env-variables");
|
23
23
|
const api_1 = require("../lib/api");
|
24
24
|
// TODO @vejvis - doufám, že tohle bude fungovat
|
25
|
-
const { axiosRequest, axiosInstance } = (0, api_1.createAxiosInstance)(
|
25
|
+
const { axiosRequest, axiosInstance } = (0, api_1.createAxiosInstance)((_a = process.env.NEXT_PUBLIC_FRONTEND_URL) !== null && _a !== void 0 ? _a : "");
|
26
26
|
function contentGet(ctx, contentId) {
|
27
27
|
return axiosRequest(ctx, `/api/cms/content/${contentId}`, "get", null, null);
|
28
28
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { PropsWithChildren, ReactNode } from "react";
|
2
|
-
import {
|
2
|
+
import { SWRConfiguration } from "swr";
|
3
3
|
interface Props {
|
4
|
-
|
4
|
+
swrConfig?: SWRConfiguration;
|
5
5
|
}
|
6
6
|
export declare function CmsProvider(props: PropsWithChildren<Props>): ReactNode;
|
7
7
|
export {};
|
package/context/cms-provider.js
CHANGED
@@ -8,6 +8,11 @@ const react_1 = __importDefault(require("react"));
|
|
8
8
|
const swr_1 = require("swr");
|
9
9
|
const fetcher = (input) => fetch(input).then((res) => res.json());
|
10
10
|
function CmsProvider(props) {
|
11
|
-
var _a;
|
12
|
-
|
11
|
+
var _a, _b, _c, _d;
|
12
|
+
const swrConfig = {
|
13
|
+
...props.swrConfig,
|
14
|
+
provider: (_b = (_a = props.swrConfig) === null || _a === void 0 ? void 0 : _a.provider) !== null && _b !== void 0 ? _b : (() => new Map()),
|
15
|
+
fetcher: (_d = (_c = props.swrConfig) === null || _c === void 0 ? void 0 : _c.fetcher) !== null && _d !== void 0 ? _d : fetcher,
|
16
|
+
};
|
17
|
+
return react_1.default.createElement(swr_1.SWRConfig, { value: swrConfig }, props.children);
|
13
18
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uxf/cms",
|
3
|
-
"version": "11.48.
|
3
|
+
"version": "11.48.2",
|
4
4
|
"description": "UXF Cms",
|
5
5
|
"author": "UXFans <dev@uxf.cz>",
|
6
6
|
"homepage": "https://gitlab.com/uxf-npm/cms#readme",
|
@@ -32,11 +32,11 @@
|
|
32
32
|
"@redux-devtools/extension": "3.3.0",
|
33
33
|
"@uxf/core": "11.47.0",
|
34
34
|
"@uxf/core-react": "11.47.0",
|
35
|
-
"@uxf/data-grid": "11.48.
|
36
|
-
"@uxf/form": "11.48.
|
35
|
+
"@uxf/data-grid": "11.48.2",
|
36
|
+
"@uxf/form": "11.48.2",
|
37
37
|
"@uxf/router": "11.46.0",
|
38
|
-
"@uxf/ui": "11.48.
|
39
|
-
"@uxf/wysiwyg": "11.48.
|
38
|
+
"@uxf/ui": "11.48.2",
|
39
|
+
"@uxf/wysiwyg": "11.48.2",
|
40
40
|
"axios": "1.7.5",
|
41
41
|
"axios-hooks": "5.0.2",
|
42
42
|
"es6-error": "4.1.1",
|
@@ -6,6 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.useLoggedUser = useLoggedUser;
|
7
7
|
const swr_1 = __importDefault(require("swr"));
|
8
8
|
function useLoggedUser() {
|
9
|
-
const { data, error, isLoading } = (0, swr_1.default)("/api/cms/user"
|
9
|
+
const { data, error, isLoading } = (0, swr_1.default)("/api/cms/user", {
|
10
|
+
keepPreviousData: true,
|
11
|
+
// immutable
|
12
|
+
revalidateIfStale: false,
|
13
|
+
revalidateOnFocus: false,
|
14
|
+
revalidateOnReconnect: false,
|
15
|
+
});
|
10
16
|
return { data: data === null || data === void 0 ? void 0 : data.user, error, isLoading };
|
11
17
|
}
|