@refinedev/core 5.0.6 → 5.0.8
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/CHANGELOG.md +32 -0
- package/dist/components/containers/refine/index.d.cts.map +1 -1
- package/dist/components/containers/refine/index.d.ts.map +1 -1
- package/dist/contexts/auth/index.d.cts.map +1 -1
- package/dist/contexts/auth/index.d.ts.map +1 -1
- package/dist/contexts/data/types.d.cts +1 -1
- package/dist/contexts/data/types.d.cts.map +1 -1
- package/dist/contexts/data/types.d.mts +1 -1
- package/dist/contexts/data/types.d.mts.map +1 -1
- package/dist/contexts/data/types.d.ts +1 -1
- package/dist/contexts/data/types.d.ts.map +1 -1
- package/dist/contexts/refine/index.d.cts.map +1 -1
- package/dist/contexts/refine/index.d.ts.map +1 -1
- package/dist/contexts/refine/types.d.cts +2 -0
- package/dist/contexts/refine/types.d.cts.map +1 -1
- package/dist/contexts/refine/types.d.mts +2 -0
- package/dist/contexts/refine/types.d.mts.map +2 -0
- package/dist/contexts/refine/types.d.ts +2 -0
- package/dist/contexts/refine/types.d.ts.map +1 -1
- package/dist/definitions/helpers/handleRefineOptions/index.d.cts +2 -1
- package/dist/definitions/helpers/handleRefineOptions/index.d.cts.map +1 -1
- package/dist/definitions/helpers/handleRefineOptions/index.d.mts +2 -1
- package/dist/definitions/helpers/handleRefineOptions/index.d.mts.map +2 -1
- package/dist/definitions/helpers/handleRefineOptions/index.d.ts +2 -1
- package/dist/definitions/helpers/handleRefineOptions/index.d.ts.map +1 -1
- package/dist/hooks/router/use-get-to-path/index.d.cts.map +1 -1
- package/dist/hooks/router/use-get-to-path/index.d.ts.map +1 -1
- package/dist/index.cjs +102 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +53 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/containers/refine/index.tsx +6 -1
- package/src/contexts/auth/index.tsx +4 -0
- package/src/contexts/data/types.ts +4 -0
- package/src/contexts/refine/index.tsx +1 -0
- package/src/contexts/refine/types.ts +2 -0
- package/src/definitions/helpers/handleRefineOptions/index.ts +6 -0
- package/src/hooks/router/use-get-to-path/index.ts +24 -5
- package/tasks.md +0 -354
package/dist/index.cjs
CHANGED
|
@@ -158,14 +158,16 @@ var import_react64 = __toESM(require("react"));
|
|
|
158
158
|
|
|
159
159
|
// src/hooks/auth/usePermissions/index.ts
|
|
160
160
|
var import_devtools_internal = require("@refinedev/devtools-internal");
|
|
161
|
-
var
|
|
161
|
+
var import_react_query2 = require("@tanstack/react-query");
|
|
162
162
|
|
|
163
163
|
// src/contexts/auth/index.tsx
|
|
164
164
|
var import_react = __toESM(require("react"));
|
|
165
|
+
var import_react_query = require("@tanstack/react-query");
|
|
165
166
|
var AuthProviderContext = import_react.default.createContext(
|
|
166
167
|
{}
|
|
167
168
|
);
|
|
168
169
|
var AuthProviderContextProvider = /* @__PURE__ */ __name(({ children, isProvided, ...authProvider }) => {
|
|
170
|
+
const queryClient = (0, import_react_query.useQueryClient)();
|
|
169
171
|
const handleLogin = /* @__PURE__ */ __name(async (params) => {
|
|
170
172
|
var _a;
|
|
171
173
|
try {
|
|
@@ -196,6 +198,7 @@ var AuthProviderContextProvider = /* @__PURE__ */ __name(({ children, isProvided
|
|
|
196
198
|
var _a;
|
|
197
199
|
try {
|
|
198
200
|
const result = await ((_a = authProvider.logout) == null ? void 0 : _a.call(authProvider, params));
|
|
201
|
+
queryClient.invalidateQueries();
|
|
199
202
|
return result;
|
|
200
203
|
} catch (error) {
|
|
201
204
|
console.warn(
|
|
@@ -470,6 +473,7 @@ var defaultRefineOptions = {
|
|
|
470
473
|
singular: import_pluralize.default.singular
|
|
471
474
|
},
|
|
472
475
|
disableServerSideValidation: false,
|
|
476
|
+
disableRouteChangeHandler: false,
|
|
473
477
|
title: defaultTitle
|
|
474
478
|
};
|
|
475
479
|
var RefineContext = import_react2.default.createContext({
|
|
@@ -519,7 +523,8 @@ var handleRefineOptions = /* @__PURE__ */ __name(({
|
|
|
519
523
|
reactQueryDevtoolConfig,
|
|
520
524
|
syncWithLocation,
|
|
521
525
|
undoableTimeout,
|
|
522
|
-
warnWhenUnsavedChanges
|
|
526
|
+
warnWhenUnsavedChanges,
|
|
527
|
+
disableRouteChangeHandler
|
|
523
528
|
} = {}) => {
|
|
524
529
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
525
530
|
const optionsWithDefaults = {
|
|
@@ -545,7 +550,8 @@ var handleRefineOptions = /* @__PURE__ */ __name(({
|
|
|
545
550
|
title: {
|
|
546
551
|
icon: typeof ((_g = options == null ? void 0 : options.title) == null ? void 0 : _g.icon) === "undefined" ? defaultRefineOptions.title.icon : (_h = options == null ? void 0 : options.title) == null ? void 0 : _h.icon,
|
|
547
552
|
text: typeof ((_i = options == null ? void 0 : options.title) == null ? void 0 : _i.text) === "undefined" ? defaultRefineOptions.title.text : (_j = options == null ? void 0 : options.title) == null ? void 0 : _j.text
|
|
548
|
-
}
|
|
553
|
+
},
|
|
554
|
+
disableRouteChangeHandler: (options == null ? void 0 : options.disableRouteChangeHandler) ?? disableRouteChangeHandler ?? defaultRefineOptions.disableRouteChangeHandler
|
|
549
555
|
};
|
|
550
556
|
const disableTelemetryWithDefault = (options == null ? void 0 : options.disableTelemetry) ?? disableTelemetry ?? false;
|
|
551
557
|
const reactQueryWithDefaults = {
|
|
@@ -1229,7 +1235,7 @@ function usePermissions({
|
|
|
1229
1235
|
}) {
|
|
1230
1236
|
const { getPermissions } = useAuthProviderContext();
|
|
1231
1237
|
const { keys: keys2 } = useKeys();
|
|
1232
|
-
const queryResponse = (0,
|
|
1238
|
+
const queryResponse = (0, import_react_query2.useQuery)({
|
|
1233
1239
|
queryKey: keys2().auth().action("permissions").get(),
|
|
1234
1240
|
queryFn: getPermissions ? () => getPermissions(params) : () => Promise.resolve(void 0),
|
|
1235
1241
|
enabled: !!getPermissions,
|
|
@@ -1245,13 +1251,13 @@ __name(usePermissions, "usePermissions");
|
|
|
1245
1251
|
|
|
1246
1252
|
// src/hooks/auth/useGetIdentity/index.ts
|
|
1247
1253
|
var import_devtools_internal2 = require("@refinedev/devtools-internal");
|
|
1248
|
-
var
|
|
1254
|
+
var import_react_query3 = require("@tanstack/react-query");
|
|
1249
1255
|
function useGetIdentity({
|
|
1250
1256
|
queryOptions
|
|
1251
1257
|
} = {}) {
|
|
1252
1258
|
const { getIdentity } = useAuthProviderContext();
|
|
1253
1259
|
const { keys: keys2 } = useKeys();
|
|
1254
|
-
const queryResponse = (0,
|
|
1260
|
+
const queryResponse = (0, import_react_query3.useQuery)({
|
|
1255
1261
|
queryKey: keys2().auth().action("identity").get(),
|
|
1256
1262
|
queryFn: getIdentity ?? (() => Promise.resolve({})),
|
|
1257
1263
|
retry: false,
|
|
@@ -1268,12 +1274,12 @@ __name(useGetIdentity, "useGetIdentity");
|
|
|
1268
1274
|
|
|
1269
1275
|
// src/hooks/auth/useLogout/index.ts
|
|
1270
1276
|
var import_devtools_internal3 = require("@refinedev/devtools-internal");
|
|
1271
|
-
var
|
|
1277
|
+
var import_react_query5 = require("@tanstack/react-query");
|
|
1272
1278
|
|
|
1273
1279
|
// src/hooks/auth/useInvalidateAuthStore/index.ts
|
|
1274
|
-
var
|
|
1280
|
+
var import_react_query4 = require("@tanstack/react-query");
|
|
1275
1281
|
var useInvalidateAuthStore = /* @__PURE__ */ __name(() => {
|
|
1276
|
-
const queryClient = (0,
|
|
1282
|
+
const queryClient = (0, import_react_query4.useQueryClient)();
|
|
1277
1283
|
const { keys: keys2 } = useKeys();
|
|
1278
1284
|
const invalidate = /* @__PURE__ */ __name(async () => {
|
|
1279
1285
|
await Promise.all(
|
|
@@ -1296,7 +1302,7 @@ function useLogout({
|
|
|
1296
1302
|
const { open, close } = useNotification();
|
|
1297
1303
|
const { logout: logoutFromContext } = useAuthProviderContext();
|
|
1298
1304
|
const { keys: keys2 } = useKeys();
|
|
1299
|
-
const mutation = (0,
|
|
1305
|
+
const mutation = (0, import_react_query5.useMutation)({
|
|
1300
1306
|
mutationKey: keys2().auth().action("logout").get(),
|
|
1301
1307
|
mutationFn: logoutFromContext,
|
|
1302
1308
|
...mutationOptions,
|
|
@@ -1352,7 +1358,7 @@ var buildSuccessNotification = /* @__PURE__ */ __name((successNotification) => {
|
|
|
1352
1358
|
|
|
1353
1359
|
// src/hooks/auth/useLogin/index.ts
|
|
1354
1360
|
var import_devtools_internal4 = require("@refinedev/devtools-internal");
|
|
1355
|
-
var
|
|
1361
|
+
var import_react_query6 = require("@tanstack/react-query");
|
|
1356
1362
|
function useLogin({
|
|
1357
1363
|
mutationOptions
|
|
1358
1364
|
} = {}) {
|
|
@@ -1364,7 +1370,7 @@ function useLogin({
|
|
|
1364
1370
|
const { login: loginFromContext } = useAuthProviderContext();
|
|
1365
1371
|
const { keys: keys2 } = useKeys();
|
|
1366
1372
|
const to = (_a = parsed.params) == null ? void 0 : _a.to;
|
|
1367
|
-
const mutation = (0,
|
|
1373
|
+
const mutation = (0, import_react_query6.useMutation)({
|
|
1368
1374
|
mutationKey: keys2().auth().action("login").get(),
|
|
1369
1375
|
mutationFn: loginFromContext,
|
|
1370
1376
|
onSuccess: async ({ success, redirectTo, error, successNotification }) => {
|
|
@@ -1421,7 +1427,7 @@ var buildSuccessNotification2 = /* @__PURE__ */ __name((successNotification) =>
|
|
|
1421
1427
|
|
|
1422
1428
|
// src/hooks/auth/useRegister/index.ts
|
|
1423
1429
|
var import_devtools_internal5 = require("@refinedev/devtools-internal");
|
|
1424
|
-
var
|
|
1430
|
+
var import_react_query7 = require("@tanstack/react-query");
|
|
1425
1431
|
function useRegister({
|
|
1426
1432
|
mutationOptions
|
|
1427
1433
|
} = {}) {
|
|
@@ -1430,7 +1436,7 @@ function useRegister({
|
|
|
1430
1436
|
const { close, open } = useNotification();
|
|
1431
1437
|
const { register: registerFromContext } = useAuthProviderContext();
|
|
1432
1438
|
const { keys: keys2 } = useKeys();
|
|
1433
|
-
const mutation = (0,
|
|
1439
|
+
const mutation = (0, import_react_query7.useMutation)({
|
|
1434
1440
|
mutationKey: keys2().auth().action("register").get(),
|
|
1435
1441
|
mutationFn: registerFromContext,
|
|
1436
1442
|
onSuccess: async ({ success, redirectTo, error, successNotification }) => {
|
|
@@ -1485,7 +1491,7 @@ var buildSuccessNotification3 = /* @__PURE__ */ __name((successNotification) =>
|
|
|
1485
1491
|
|
|
1486
1492
|
// src/hooks/auth/useForgotPassword/index.ts
|
|
1487
1493
|
var import_devtools_internal6 = require("@refinedev/devtools-internal");
|
|
1488
|
-
var
|
|
1494
|
+
var import_react_query8 = require("@tanstack/react-query");
|
|
1489
1495
|
function useForgotPassword({
|
|
1490
1496
|
mutationOptions
|
|
1491
1497
|
} = {}) {
|
|
@@ -1493,7 +1499,7 @@ function useForgotPassword({
|
|
|
1493
1499
|
const { open, close } = useNotification();
|
|
1494
1500
|
const { forgotPassword: forgotPasswordFromContext } = useAuthProviderContext();
|
|
1495
1501
|
const { keys: keys2 } = useKeys();
|
|
1496
|
-
const mutation = (0,
|
|
1502
|
+
const mutation = (0, import_react_query8.useMutation)({
|
|
1497
1503
|
mutationKey: keys2().auth().action("forgotPassword").get(),
|
|
1498
1504
|
mutationFn: forgotPasswordFromContext,
|
|
1499
1505
|
onSuccess: ({ success, redirectTo, error, successNotification }) => {
|
|
@@ -1543,7 +1549,7 @@ var buildSuccessNotification4 = /* @__PURE__ */ __name((successNotification) =>
|
|
|
1543
1549
|
|
|
1544
1550
|
// src/hooks/auth/useUpdatePassword/index.ts
|
|
1545
1551
|
var import_devtools_internal7 = require("@refinedev/devtools-internal");
|
|
1546
|
-
var
|
|
1552
|
+
var import_react_query9 = require("@tanstack/react-query");
|
|
1547
1553
|
function useUpdatePassword({
|
|
1548
1554
|
mutationOptions
|
|
1549
1555
|
} = {}) {
|
|
@@ -1553,7 +1559,7 @@ function useUpdatePassword({
|
|
|
1553
1559
|
const { keys: keys2 } = useKeys();
|
|
1554
1560
|
const parsed = useParsed();
|
|
1555
1561
|
const params = parsed.params ?? {};
|
|
1556
|
-
const mutation = (0,
|
|
1562
|
+
const mutation = (0, import_react_query9.useMutation)({
|
|
1557
1563
|
mutationKey: keys2().auth().action("updatePassword").get(),
|
|
1558
1564
|
mutationFn: async (variables) => {
|
|
1559
1565
|
return updatePasswordFromContext == null ? void 0 : updatePasswordFromContext({
|
|
@@ -1608,14 +1614,14 @@ var buildSuccessNotification5 = /* @__PURE__ */ __name((successNotification) =>
|
|
|
1608
1614
|
|
|
1609
1615
|
// src/hooks/auth/useIsAuthenticated/index.ts
|
|
1610
1616
|
var import_devtools_internal8 = require("@refinedev/devtools-internal");
|
|
1611
|
-
var
|
|
1617
|
+
var import_react_query10 = require("@tanstack/react-query");
|
|
1612
1618
|
function useIsAuthenticated({
|
|
1613
1619
|
queryOptions,
|
|
1614
1620
|
params
|
|
1615
1621
|
} = {}) {
|
|
1616
1622
|
const { check } = useAuthProviderContext();
|
|
1617
1623
|
const { keys: keys2 } = useKeys();
|
|
1618
|
-
const queryResponse = (0,
|
|
1624
|
+
const queryResponse = (0, import_react_query10.useQuery)({
|
|
1619
1625
|
queryKey: keys2().auth().action("check").get(),
|
|
1620
1626
|
queryFn: async () => await (check == null ? void 0 : check(params)) ?? { authenticated: true },
|
|
1621
1627
|
retry: false,
|
|
@@ -1631,13 +1637,13 @@ __name(useIsAuthenticated, "useIsAuthenticated");
|
|
|
1631
1637
|
|
|
1632
1638
|
// src/hooks/auth/useOnError/index.ts
|
|
1633
1639
|
var import_devtools_internal9 = require("@refinedev/devtools-internal");
|
|
1634
|
-
var
|
|
1640
|
+
var import_react_query11 = require("@tanstack/react-query");
|
|
1635
1641
|
function useOnError() {
|
|
1636
1642
|
const go = useGo();
|
|
1637
1643
|
const { onError: onErrorFromContext } = useAuthProviderContext();
|
|
1638
1644
|
const { keys: keys2 } = useKeys();
|
|
1639
1645
|
const { mutate: logout } = useLogout();
|
|
1640
|
-
const mutation = (0,
|
|
1646
|
+
const mutation = (0, import_react_query11.useMutation)({
|
|
1641
1647
|
mutationKey: keys2().auth().action("onError").get(),
|
|
1642
1648
|
...onErrorFromContext ? {
|
|
1643
1649
|
mutationFn: onErrorFromContext,
|
|
@@ -1674,7 +1680,7 @@ var useIsExistAuthentication = /* @__PURE__ */ __name(() => {
|
|
|
1674
1680
|
var import_react10 = require("react");
|
|
1675
1681
|
var import_devtools_internal10 = require("@refinedev/devtools-internal");
|
|
1676
1682
|
var import_react11 = require("react");
|
|
1677
|
-
var
|
|
1683
|
+
var import_react_query12 = require("@tanstack/react-query");
|
|
1678
1684
|
|
|
1679
1685
|
// src/hooks/useLoadingOvertime/index.ts
|
|
1680
1686
|
var import_react9 = require("react");
|
|
@@ -1814,7 +1820,7 @@ var useList = /* @__PURE__ */ __name(({
|
|
|
1814
1820
|
prefferedPagination.mode,
|
|
1815
1821
|
queryOptions == null ? void 0 : queryOptions.select
|
|
1816
1822
|
]);
|
|
1817
|
-
const queryResponse = (0,
|
|
1823
|
+
const queryResponse = (0, import_react_query12.useQuery)({
|
|
1818
1824
|
queryKey: keys2().data(pickedDataProvider).resource(identifier ?? "").action("list").params({
|
|
1819
1825
|
...preferredMeta || {},
|
|
1820
1826
|
filters: prefferedFilters,
|
|
@@ -1893,7 +1899,7 @@ var useList = /* @__PURE__ */ __name(({
|
|
|
1893
1899
|
// src/hooks/data/useOne.ts
|
|
1894
1900
|
var import_react12 = require("react");
|
|
1895
1901
|
var import_devtools_internal11 = require("@refinedev/devtools-internal");
|
|
1896
|
-
var
|
|
1902
|
+
var import_react_query13 = require("@tanstack/react-query");
|
|
1897
1903
|
var useOne = /* @__PURE__ */ __name(({
|
|
1898
1904
|
resource: resourceFromProp,
|
|
1899
1905
|
id,
|
|
@@ -1945,7 +1951,7 @@ var useOne = /* @__PURE__ */ __name(({
|
|
|
1945
1951
|
dataProviderName: pickedDataProvider
|
|
1946
1952
|
}
|
|
1947
1953
|
});
|
|
1948
|
-
const queryResponse = (0,
|
|
1954
|
+
const queryResponse = (0, import_react_query13.useQuery)({
|
|
1949
1955
|
queryKey: keys2().data(pickedDataProvider).resource(identifier ?? "").action("one").id(id ?? "").params({
|
|
1950
1956
|
...preferredMeta || {}
|
|
1951
1957
|
}).get(),
|
|
@@ -2014,7 +2020,7 @@ var useOne = /* @__PURE__ */ __name(({
|
|
|
2014
2020
|
// src/hooks/data/useMany.ts
|
|
2015
2021
|
var import_react13 = require("react");
|
|
2016
2022
|
var import_devtools_internal12 = require("@refinedev/devtools-internal");
|
|
2017
|
-
var
|
|
2023
|
+
var import_react_query14 = require("@tanstack/react-query");
|
|
2018
2024
|
var import_warn_once2 = __toESM(require("warn-once"));
|
|
2019
2025
|
var EMPTY_ARRAY2 = Object.freeze([]);
|
|
2020
2026
|
var useMany = /* @__PURE__ */ __name(({
|
|
@@ -2075,7 +2081,7 @@ var useMany = /* @__PURE__ */ __name(({
|
|
|
2075
2081
|
dataProviderName: pickedDataProvider
|
|
2076
2082
|
}
|
|
2077
2083
|
});
|
|
2078
|
-
const queryResponse = (0,
|
|
2084
|
+
const queryResponse = (0, import_react_query14.useQuery)({
|
|
2079
2085
|
queryKey: keys2().data(pickedDataProvider).resource(identifier).action("many").ids(...ids ?? []).params({
|
|
2080
2086
|
...preferredMeta || {}
|
|
2081
2087
|
}).get(),
|
|
@@ -2151,7 +2157,7 @@ See https://refine.dev/docs/data/hooks/use-many/#resource-`, "resourceWarningMes
|
|
|
2151
2157
|
|
|
2152
2158
|
// src/hooks/data/useUpdate.ts
|
|
2153
2159
|
var import_devtools_internal13 = require("@refinedev/devtools-internal");
|
|
2154
|
-
var
|
|
2160
|
+
var import_react_query15 = require("@tanstack/react-query");
|
|
2155
2161
|
|
|
2156
2162
|
// src/contexts/undoableQueue/types.ts
|
|
2157
2163
|
var ActionTypes = /* @__PURE__ */ ((ActionTypes2) => {
|
|
@@ -2181,7 +2187,7 @@ var useUpdate = /* @__PURE__ */ __name(({
|
|
|
2181
2187
|
const { resources, select } = useResourceParams({
|
|
2182
2188
|
resource: resourceFromProps
|
|
2183
2189
|
});
|
|
2184
|
-
const queryClient = (0,
|
|
2190
|
+
const queryClient = (0, import_react_query15.useQueryClient)();
|
|
2185
2191
|
const dataProvider = useDataProvider();
|
|
2186
2192
|
const {
|
|
2187
2193
|
mutationMode: mutationModeContext,
|
|
@@ -2199,7 +2205,7 @@ var useUpdate = /* @__PURE__ */ __name(({
|
|
|
2199
2205
|
options: { textTransformers }
|
|
2200
2206
|
} = useRefineContext();
|
|
2201
2207
|
const { keys: keys2 } = useKeys();
|
|
2202
|
-
const mutationResult = (0,
|
|
2208
|
+
const mutationResult = (0, import_react_query15.useMutation)({
|
|
2203
2209
|
mutationFn: ({
|
|
2204
2210
|
id = idFromProps,
|
|
2205
2211
|
values = valuesFromProps,
|
|
@@ -2578,7 +2584,7 @@ var missingValuesError = new Error(
|
|
|
2578
2584
|
|
|
2579
2585
|
// src/hooks/data/useCreate.ts
|
|
2580
2586
|
var import_devtools_internal14 = require("@refinedev/devtools-internal");
|
|
2581
|
-
var
|
|
2587
|
+
var import_react_query16 = require("@tanstack/react-query");
|
|
2582
2588
|
var useCreate = /* @__PURE__ */ __name(({
|
|
2583
2589
|
resource: resourceFromProps,
|
|
2584
2590
|
values: valuesFromProps,
|
|
@@ -2603,7 +2609,7 @@ var useCreate = /* @__PURE__ */ __name(({
|
|
|
2603
2609
|
options: { textTransformers }
|
|
2604
2610
|
} = useRefineContext();
|
|
2605
2611
|
const { keys: keys2 } = useKeys();
|
|
2606
|
-
const mutationResult = (0,
|
|
2612
|
+
const mutationResult = (0, import_react_query16.useMutation)({
|
|
2607
2613
|
mutationFn: ({
|
|
2608
2614
|
resource: resourceName = resourceFromProps,
|
|
2609
2615
|
values = valuesFromProps,
|
|
@@ -2770,7 +2776,7 @@ var missingValuesError2 = new Error(
|
|
|
2770
2776
|
|
|
2771
2777
|
// src/hooks/data/useDelete.ts
|
|
2772
2778
|
var import_devtools_internal15 = require("@refinedev/devtools-internal");
|
|
2773
|
-
var
|
|
2779
|
+
var import_react_query17 = require("@tanstack/react-query");
|
|
2774
2780
|
var useDelete = /* @__PURE__ */ __name(({
|
|
2775
2781
|
mutationOptions,
|
|
2776
2782
|
overtimeOptions
|
|
@@ -2778,7 +2784,7 @@ var useDelete = /* @__PURE__ */ __name(({
|
|
|
2778
2784
|
const { mutate: checkError } = useOnError();
|
|
2779
2785
|
const dataProvider = useDataProvider();
|
|
2780
2786
|
const { resources, select } = useResourceParams();
|
|
2781
|
-
const queryClient = (0,
|
|
2787
|
+
const queryClient = (0, import_react_query17.useQueryClient)();
|
|
2782
2788
|
const {
|
|
2783
2789
|
mutationMode: mutationModeContext,
|
|
2784
2790
|
undoableTimeout: undoableTimeoutContext
|
|
@@ -2794,7 +2800,7 @@ var useDelete = /* @__PURE__ */ __name(({
|
|
|
2794
2800
|
options: { textTransformers }
|
|
2795
2801
|
} = useRefineContext();
|
|
2796
2802
|
const { keys: keys2 } = useKeys();
|
|
2797
|
-
const mutation = (0,
|
|
2803
|
+
const mutation = (0, import_react_query17.useMutation)({
|
|
2798
2804
|
mutationFn: ({
|
|
2799
2805
|
id,
|
|
2800
2806
|
mutationMode,
|
|
@@ -3054,7 +3060,7 @@ var useDelete = /* @__PURE__ */ __name(({
|
|
|
3054
3060
|
|
|
3055
3061
|
// src/hooks/data/useCreateMany.ts
|
|
3056
3062
|
var import_devtools_internal16 = require("@refinedev/devtools-internal");
|
|
3057
|
-
var
|
|
3063
|
+
var import_react_query18 = require("@tanstack/react-query");
|
|
3058
3064
|
var useCreateMany = /* @__PURE__ */ __name(({
|
|
3059
3065
|
resource: resourceFromProps,
|
|
3060
3066
|
values: valuesFromProps,
|
|
@@ -3078,7 +3084,7 @@ var useCreateMany = /* @__PURE__ */ __name(({
|
|
|
3078
3084
|
options: { textTransformers }
|
|
3079
3085
|
} = useRefineContext();
|
|
3080
3086
|
const { keys: keys2 } = useKeys();
|
|
3081
|
-
const mutationResult = (0,
|
|
3087
|
+
const mutationResult = (0, import_react_query18.useMutation)({
|
|
3082
3088
|
mutationFn: ({
|
|
3083
3089
|
resource: resourceName = resourceFromProps,
|
|
3084
3090
|
values = valuesFromProps,
|
|
@@ -3250,7 +3256,7 @@ var missingValuesError3 = new Error(
|
|
|
3250
3256
|
|
|
3251
3257
|
// src/hooks/data/useUpdateMany.ts
|
|
3252
3258
|
var import_devtools_internal17 = require("@refinedev/devtools-internal");
|
|
3253
|
-
var
|
|
3259
|
+
var import_react_query19 = require("@tanstack/react-query");
|
|
3254
3260
|
var useUpdateMany = /* @__PURE__ */ __name(({
|
|
3255
3261
|
ids: idsFromProps,
|
|
3256
3262
|
resource: resourceFromProps,
|
|
@@ -3268,7 +3274,7 @@ var useUpdateMany = /* @__PURE__ */ __name(({
|
|
|
3268
3274
|
overtimeOptions
|
|
3269
3275
|
} = {}) => {
|
|
3270
3276
|
const { resources, select } = useResourceParams();
|
|
3271
|
-
const queryClient = (0,
|
|
3277
|
+
const queryClient = (0, import_react_query19.useQueryClient)();
|
|
3272
3278
|
const dataProvider = useDataProvider();
|
|
3273
3279
|
const translate = useTranslate();
|
|
3274
3280
|
const {
|
|
@@ -3286,7 +3292,7 @@ var useUpdateMany = /* @__PURE__ */ __name(({
|
|
|
3286
3292
|
options: { textTransformers }
|
|
3287
3293
|
} = useRefineContext();
|
|
3288
3294
|
const { keys: keys2 } = useKeys();
|
|
3289
|
-
const mutationResult = (0,
|
|
3295
|
+
const mutationResult = (0, import_react_query19.useMutation)({
|
|
3290
3296
|
mutationFn: ({
|
|
3291
3297
|
ids = idsFromProps,
|
|
3292
3298
|
values = valuesFromProps,
|
|
@@ -3683,7 +3689,7 @@ var missingValuesError4 = new Error(
|
|
|
3683
3689
|
|
|
3684
3690
|
// src/hooks/data/useDeleteMany.ts
|
|
3685
3691
|
var import_devtools_internal18 = require("@refinedev/devtools-internal");
|
|
3686
|
-
var
|
|
3692
|
+
var import_react_query20 = require("@tanstack/react-query");
|
|
3687
3693
|
var useDeleteMany = /* @__PURE__ */ __name(({
|
|
3688
3694
|
mutationOptions,
|
|
3689
3695
|
overtimeOptions
|
|
@@ -3701,13 +3707,13 @@ var useDeleteMany = /* @__PURE__ */ __name(({
|
|
|
3701
3707
|
const invalidateStore = useInvalidate();
|
|
3702
3708
|
const { log } = useLog();
|
|
3703
3709
|
const { resources, select } = useResourceParams();
|
|
3704
|
-
const queryClient = (0,
|
|
3710
|
+
const queryClient = (0, import_react_query20.useQueryClient)();
|
|
3705
3711
|
const getMeta = useMeta();
|
|
3706
3712
|
const {
|
|
3707
3713
|
options: { textTransformers }
|
|
3708
3714
|
} = useRefineContext();
|
|
3709
3715
|
const { keys: keys2 } = useKeys();
|
|
3710
|
-
const mutation = (0,
|
|
3716
|
+
const mutation = (0, import_react_query20.useMutation)({
|
|
3711
3717
|
mutationFn: ({
|
|
3712
3718
|
resource: resourceName,
|
|
3713
3719
|
ids,
|
|
@@ -4000,7 +4006,7 @@ var useApiUrl = /* @__PURE__ */ __name((dataProviderName) => {
|
|
|
4000
4006
|
// src/hooks/data/useCustom.ts
|
|
4001
4007
|
var import_react14 = require("react");
|
|
4002
4008
|
var import_devtools_internal19 = require("@refinedev/devtools-internal");
|
|
4003
|
-
var
|
|
4009
|
+
var import_react_query21 = require("@tanstack/react-query");
|
|
4004
4010
|
var EMPTY_OBJECT = Object.freeze({});
|
|
4005
4011
|
var useCustom = /* @__PURE__ */ __name(({
|
|
4006
4012
|
url,
|
|
@@ -4024,7 +4030,7 @@ var useCustom = /* @__PURE__ */ __name(({
|
|
|
4024
4030
|
const { custom } = dataProvider(dataProviderName);
|
|
4025
4031
|
const combinedMeta = getMeta({ meta: preferredMeta });
|
|
4026
4032
|
if (custom) {
|
|
4027
|
-
const queryResponse = (0,
|
|
4033
|
+
const queryResponse = (0, import_react_query21.useQuery)({
|
|
4028
4034
|
queryKey: keys2().data(dataProviderName).mutation("custom").params({
|
|
4029
4035
|
method,
|
|
4030
4036
|
url,
|
|
@@ -4091,7 +4097,7 @@ var useCustom = /* @__PURE__ */ __name(({
|
|
|
4091
4097
|
|
|
4092
4098
|
// src/hooks/data/useCustomMutation.ts
|
|
4093
4099
|
var import_devtools_internal20 = require("@refinedev/devtools-internal");
|
|
4094
|
-
var
|
|
4100
|
+
var import_react_query22 = require("@tanstack/react-query");
|
|
4095
4101
|
var useCustomMutation = /* @__PURE__ */ __name(({
|
|
4096
4102
|
mutationOptions,
|
|
4097
4103
|
overtimeOptions
|
|
@@ -4102,7 +4108,7 @@ var useCustomMutation = /* @__PURE__ */ __name(({
|
|
|
4102
4108
|
const translate = useTranslate();
|
|
4103
4109
|
const getMeta = useMeta();
|
|
4104
4110
|
const { keys: keys2 } = useKeys();
|
|
4105
|
-
const mutationResult = (0,
|
|
4111
|
+
const mutationResult = (0, import_react_query22.useMutation)({
|
|
4106
4112
|
mutationKey: keys2().data().mutation("customMutation").get(),
|
|
4107
4113
|
mutationFn: ({
|
|
4108
4114
|
url,
|
|
@@ -4242,7 +4248,7 @@ var useDataProvider = /* @__PURE__ */ __name(() => {
|
|
|
4242
4248
|
// src/hooks/data/useInfiniteList.ts
|
|
4243
4249
|
var import_react17 = require("react");
|
|
4244
4250
|
var import_devtools_internal21 = require("@refinedev/devtools-internal");
|
|
4245
|
-
var
|
|
4251
|
+
var import_react_query23 = require("@tanstack/react-query");
|
|
4246
4252
|
var useInfiniteList = /* @__PURE__ */ __name(({
|
|
4247
4253
|
resource: resourceFromProp,
|
|
4248
4254
|
filters,
|
|
@@ -4314,7 +4320,7 @@ var useInfiniteList = /* @__PURE__ */ __name(({
|
|
|
4314
4320
|
dataProviderName: pickedDataProvider
|
|
4315
4321
|
}
|
|
4316
4322
|
});
|
|
4317
|
-
const queryResponse = (0,
|
|
4323
|
+
const queryResponse = (0, import_react_query23.useInfiniteQuery)({
|
|
4318
4324
|
queryKey: keys2().data(pickedDataProvider).resource(identifier).action("infinite").params({
|
|
4319
4325
|
...preferredMeta || {},
|
|
4320
4326
|
filters: prefferedFilters,
|
|
@@ -4428,10 +4434,10 @@ var LiveContextProvider = /* @__PURE__ */ __name(({
|
|
|
4428
4434
|
|
|
4429
4435
|
// src/hooks/invalidate/index.tsx
|
|
4430
4436
|
var import_react19 = require("react");
|
|
4431
|
-
var
|
|
4437
|
+
var import_react_query24 = require("@tanstack/react-query");
|
|
4432
4438
|
var useInvalidate = /* @__PURE__ */ __name(() => {
|
|
4433
4439
|
const { resources } = useResourceParams();
|
|
4434
|
-
const queryClient = (0,
|
|
4440
|
+
const queryClient = (0, import_react_query24.useQueryClient)();
|
|
4435
4441
|
const { keys: keys2 } = useKeys();
|
|
4436
4442
|
const invalidate = (0, import_react19.useCallback)(
|
|
4437
4443
|
async ({
|
|
@@ -5302,6 +5308,7 @@ __name(useResourceParams, "useResourceParams");
|
|
|
5302
5308
|
|
|
5303
5309
|
// src/hooks/router/use-get-to-path/index.ts
|
|
5304
5310
|
var import_react44 = __toESM(require("react"));
|
|
5311
|
+
var import_warn_once4 = __toESM(require("warn-once"));
|
|
5305
5312
|
var useGetToPath = /* @__PURE__ */ __name(() => {
|
|
5306
5313
|
const { resource: resourceFromRoute, resources } = useResourceParams();
|
|
5307
5314
|
const parsed = useParsed();
|
|
@@ -5312,19 +5319,31 @@ var useGetToPath = /* @__PURE__ */ __name(() => {
|
|
|
5312
5319
|
if (!selectedResource) {
|
|
5313
5320
|
return void 0;
|
|
5314
5321
|
}
|
|
5315
|
-
const
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5322
|
+
const fullResource = resources.find((r) => {
|
|
5323
|
+
if (!r.identifier)
|
|
5324
|
+
return false;
|
|
5325
|
+
if (!selectedResource.identifier)
|
|
5326
|
+
return false;
|
|
5327
|
+
return r.identifier === selectedResource.identifier;
|
|
5328
|
+
}) ?? resources.find((r) => {
|
|
5329
|
+
if (!r.identifier)
|
|
5330
|
+
return false;
|
|
5331
|
+
return r.identifier === selectedResource.name;
|
|
5332
|
+
}) ?? resources.find((r) => r.name === selectedResource.name) ?? selectedResource;
|
|
5333
|
+
const actionRoutes = getActionRoutesFromResource(fullResource, resources);
|
|
5319
5334
|
const actionRoute = (_a = actionRoutes.find(
|
|
5320
5335
|
(item) => item.action === action
|
|
5321
5336
|
)) == null ? void 0 : _a.route;
|
|
5322
5337
|
if (!actionRoute) {
|
|
5338
|
+
(0, import_warn_once4.default)(
|
|
5339
|
+
true,
|
|
5340
|
+
`[useGetToPath]: Could not find a route for the "${action}" action of the "${selectedResource.name}" resource. Please make sure that the resource has the "${action}" property defined.`
|
|
5341
|
+
);
|
|
5323
5342
|
return void 0;
|
|
5324
5343
|
}
|
|
5325
5344
|
const composed = composeRoute(
|
|
5326
5345
|
actionRoute,
|
|
5327
|
-
|
|
5346
|
+
fullResource == null ? void 0 : fullResource.meta,
|
|
5328
5347
|
parsed,
|
|
5329
5348
|
meta
|
|
5330
5349
|
);
|
|
@@ -5516,7 +5535,7 @@ var useNavigation2 = /* @__PURE__ */ __name(() => {
|
|
|
5516
5535
|
}, "useNavigation");
|
|
5517
5536
|
|
|
5518
5537
|
// src/hooks/show/index.ts
|
|
5519
|
-
var
|
|
5538
|
+
var import_warn_once5 = __toESM(require("warn-once"));
|
|
5520
5539
|
var useShow = /* @__PURE__ */ __name(({
|
|
5521
5540
|
resource: resourceFromProp,
|
|
5522
5541
|
id,
|
|
@@ -5539,7 +5558,7 @@ var useShow = /* @__PURE__ */ __name(({
|
|
|
5539
5558
|
resource,
|
|
5540
5559
|
meta
|
|
5541
5560
|
});
|
|
5542
|
-
(0,
|
|
5561
|
+
(0, import_warn_once5.default)(
|
|
5543
5562
|
Boolean(resourceFromProp) && !showId,
|
|
5544
5563
|
idWarningMessage2(identifier, showId)
|
|
5545
5564
|
);
|
|
@@ -5770,7 +5789,7 @@ var useToPath = /* @__PURE__ */ __name(({
|
|
|
5770
5789
|
|
|
5771
5790
|
// src/components/link/index.tsx
|
|
5772
5791
|
var import_react49 = __toESM(require("react"));
|
|
5773
|
-
var
|
|
5792
|
+
var import_warn_once6 = __toESM(require("warn-once"));
|
|
5774
5793
|
var LinkComponent = /* @__PURE__ */ __name((props, ref) => {
|
|
5775
5794
|
const routerContext = (0, import_react49.useContext)(RouterContext);
|
|
5776
5795
|
const LinkFromContext = routerContext == null ? void 0 : routerContext.Link;
|
|
@@ -5778,7 +5797,7 @@ var LinkComponent = /* @__PURE__ */ __name((props, ref) => {
|
|
|
5778
5797
|
let resolvedTo = "";
|
|
5779
5798
|
if ("go" in props) {
|
|
5780
5799
|
if (!(routerContext == null ? void 0 : routerContext.go)) {
|
|
5781
|
-
(0,
|
|
5800
|
+
(0, import_warn_once6.default)(
|
|
5782
5801
|
true,
|
|
5783
5802
|
"[Link]: `routerProvider` is not found. To use `go`, Please make sure that you have provided the `routerProvider` for `<Refine />` https://refine.dev/docs/routing/router-provider/ \n"
|
|
5784
5803
|
);
|
|
@@ -5820,7 +5839,7 @@ var useLink = /* @__PURE__ */ __name(() => {
|
|
|
5820
5839
|
// src/hooks/accessControl/useCan/index.ts
|
|
5821
5840
|
var import_react51 = require("react");
|
|
5822
5841
|
var import_devtools_internal22 = require("@refinedev/devtools-internal");
|
|
5823
|
-
var
|
|
5842
|
+
var import_react_query25 = require("@tanstack/react-query");
|
|
5824
5843
|
|
|
5825
5844
|
// src/contexts/accessControl/index.tsx
|
|
5826
5845
|
var import_react50 = __toESM(require("react"));
|
|
@@ -5894,7 +5913,7 @@ var useCan = /* @__PURE__ */ __name(({
|
|
|
5894
5913
|
};
|
|
5895
5914
|
const { resource: _resource, ...paramsRest } = params ?? {};
|
|
5896
5915
|
const sanitizedResource = sanitizeResource(_resource);
|
|
5897
|
-
const queryResponse = (0,
|
|
5916
|
+
const queryResponse = (0, import_react_query25.useQuery)({
|
|
5898
5917
|
queryKey: keys2().access().resource(resource).action(action).params({
|
|
5899
5918
|
params: { ...paramsRest, resource: sanitizedResource },
|
|
5900
5919
|
enabled: mergedQueryOptions == null ? void 0 : mergedQueryOptions.enabled
|
|
@@ -6123,7 +6142,7 @@ var useSelect = /* @__PURE__ */ __name((props) => {
|
|
|
6123
6142
|
var import_react54 = __toESM(require("react"));
|
|
6124
6143
|
var import_differenceWith2 = __toESM(require("lodash/differenceWith"));
|
|
6125
6144
|
var import_isEqual3 = __toESM(require("lodash/isEqual"));
|
|
6126
|
-
var
|
|
6145
|
+
var import_warn_once7 = __toESM(require("warn-once"));
|
|
6127
6146
|
var defaultPermanentFilter = [];
|
|
6128
6147
|
var defaultPermanentSorter = [];
|
|
6129
6148
|
var EMPTY_ARRAY3 = Object.freeze([]);
|
|
@@ -6185,7 +6204,7 @@ function useTable({
|
|
|
6185
6204
|
meta: preferredMeta
|
|
6186
6205
|
});
|
|
6187
6206
|
import_react54.default.useEffect(() => {
|
|
6188
|
-
(0,
|
|
6207
|
+
(0, import_warn_once7.default)(
|
|
6189
6208
|
typeof identifier === "undefined",
|
|
6190
6209
|
"useTable: `resource` is not defined."
|
|
6191
6210
|
);
|
|
@@ -6330,7 +6349,7 @@ __name(useTable, "useTable");
|
|
|
6330
6349
|
// src/hooks/auditLog/useLog/index.ts
|
|
6331
6350
|
var import_react56 = require("react");
|
|
6332
6351
|
var import_devtools_internal23 = require("@refinedev/devtools-internal");
|
|
6333
|
-
var
|
|
6352
|
+
var import_react_query26 = require("@tanstack/react-query");
|
|
6334
6353
|
|
|
6335
6354
|
// src/contexts/auditLog/index.tsx
|
|
6336
6355
|
var import_react55 = __toESM(require("react"));
|
|
@@ -6344,7 +6363,7 @@ var useLog = /* @__PURE__ */ __name(({
|
|
|
6344
6363
|
logMutationOptions,
|
|
6345
6364
|
renameMutationOptions
|
|
6346
6365
|
} = {}) => {
|
|
6347
|
-
const queryClient = (0,
|
|
6366
|
+
const queryClient = (0, import_react_query26.useQueryClient)();
|
|
6348
6367
|
const auditLogContext = (0, import_react56.useContext)(AuditLogContext);
|
|
6349
6368
|
const { keys: keys2 } = useKeys();
|
|
6350
6369
|
const { resources } = (0, import_react56.useContext)(ResourceContext);
|
|
@@ -6357,7 +6376,7 @@ var useLog = /* @__PURE__ */ __name(({
|
|
|
6357
6376
|
enabled: !!(auditLogContext == null ? void 0 : auditLogContext.create)
|
|
6358
6377
|
}
|
|
6359
6378
|
});
|
|
6360
|
-
const log = (0,
|
|
6379
|
+
const log = (0, import_react_query26.useMutation)({
|
|
6361
6380
|
mutationFn: async (params) => {
|
|
6362
6381
|
var _a, _b;
|
|
6363
6382
|
const resource = pickResource(params.resource, resources);
|
|
@@ -6383,7 +6402,7 @@ var useLog = /* @__PURE__ */ __name(({
|
|
|
6383
6402
|
...(0, import_devtools_internal23.getXRay)("useLog")
|
|
6384
6403
|
}
|
|
6385
6404
|
});
|
|
6386
|
-
const rename = (0,
|
|
6405
|
+
const rename = (0, import_react_query26.useMutation)({
|
|
6387
6406
|
mutationFn: async (params) => {
|
|
6388
6407
|
var _a;
|
|
6389
6408
|
return await ((_a = auditLogContext.update) == null ? void 0 : _a.call(auditLogContext, params));
|
|
@@ -6408,7 +6427,7 @@ var useLog = /* @__PURE__ */ __name(({
|
|
|
6408
6427
|
// src/hooks/auditLog/useLogList/index.ts
|
|
6409
6428
|
var import_react57 = require("react");
|
|
6410
6429
|
var import_devtools_internal24 = require("@refinedev/devtools-internal");
|
|
6411
|
-
var
|
|
6430
|
+
var import_react_query27 = require("@tanstack/react-query");
|
|
6412
6431
|
var useLogList = /* @__PURE__ */ __name(({
|
|
6413
6432
|
resource,
|
|
6414
6433
|
action,
|
|
@@ -6418,7 +6437,7 @@ var useLogList = /* @__PURE__ */ __name(({
|
|
|
6418
6437
|
}) => {
|
|
6419
6438
|
const { get: get2 } = (0, import_react57.useContext)(AuditLogContext);
|
|
6420
6439
|
const { keys: keys2 } = useKeys();
|
|
6421
|
-
const queryResponse = (0,
|
|
6440
|
+
const queryResponse = (0, import_react_query27.useQuery)({
|
|
6422
6441
|
queryKey: keys2().audit().resource(resource).action("list").params(meta).get(),
|
|
6423
6442
|
queryFn: () => (get2 == null ? void 0 : get2({
|
|
6424
6443
|
resource,
|
|
@@ -6439,7 +6458,7 @@ var useLogList = /* @__PURE__ */ __name(({
|
|
|
6439
6458
|
|
|
6440
6459
|
// src/hooks/breadcrumb/index.ts
|
|
6441
6460
|
var import_react58 = require("react");
|
|
6442
|
-
var
|
|
6461
|
+
var import_warn_once8 = __toESM(require("warn-once"));
|
|
6443
6462
|
var useBreadcrumb = /* @__PURE__ */ __name(({
|
|
6444
6463
|
meta: metaFromProps = {}
|
|
6445
6464
|
} = {}) => {
|
|
@@ -6485,7 +6504,7 @@ var useBreadcrumb = /* @__PURE__ */ __name(({
|
|
|
6485
6504
|
const key = `actions.${action}`;
|
|
6486
6505
|
const actionLabel = translate(key);
|
|
6487
6506
|
if (typeof i18nProvider !== "undefined" && actionLabel === key) {
|
|
6488
|
-
(0,
|
|
6507
|
+
(0, import_warn_once8.default)(
|
|
6489
6508
|
true,
|
|
6490
6509
|
`[useBreadcrumb]: Breadcrumb missing translate key for the "${action}" action. Please add "actions.${action}" key to your translation file.
|
|
6491
6510
|
For more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`
|
|
@@ -6877,11 +6896,11 @@ function useDeleteButton(props) {
|
|
|
6877
6896
|
__name(useDeleteButton, "useDeleteButton");
|
|
6878
6897
|
|
|
6879
6898
|
// src/hooks/button/refresh-button/index.tsx
|
|
6880
|
-
var
|
|
6899
|
+
var import_react_query28 = require("@tanstack/react-query");
|
|
6881
6900
|
function useRefreshButton(props) {
|
|
6882
6901
|
const translate = useTranslate();
|
|
6883
6902
|
const { keys: keys2 } = useKeys();
|
|
6884
|
-
const queryClient = (0,
|
|
6903
|
+
const queryClient = (0, import_react_query28.useQueryClient)();
|
|
6885
6904
|
const invalidates = useInvalidate();
|
|
6886
6905
|
const { identifier, id, resources } = useResourceParams({
|
|
6887
6906
|
resource: props.resource,
|
|
@@ -8167,14 +8186,14 @@ var WelcomePage = /* @__PURE__ */ __name(() => {
|
|
|
8167
8186
|
// src/components/containers/refine/index.tsx
|
|
8168
8187
|
var import_react76 = __toESM(require("react"));
|
|
8169
8188
|
var import_devtools_internal25 = require("@refinedev/devtools-internal");
|
|
8170
|
-
var
|
|
8189
|
+
var import_react_query29 = require("@tanstack/react-query");
|
|
8171
8190
|
|
|
8172
8191
|
// src/components/telemetry/index.tsx
|
|
8173
8192
|
var import_react74 = __toESM(require("react"));
|
|
8174
8193
|
|
|
8175
8194
|
// src/hooks/useTelemetryData/index.ts
|
|
8176
8195
|
var import_react73 = require("react");
|
|
8177
|
-
var REFINE_VERSION = "5.0.
|
|
8196
|
+
var REFINE_VERSION = "5.0.8";
|
|
8178
8197
|
var useTelemetryData = /* @__PURE__ */ __name(() => {
|
|
8179
8198
|
var _a;
|
|
8180
8199
|
const auth = useIsExistAuthentication();
|
|
@@ -8313,18 +8332,19 @@ var Refine = /* @__PURE__ */ __name(({
|
|
|
8313
8332
|
} = handleRefineOptions({
|
|
8314
8333
|
options
|
|
8315
8334
|
});
|
|
8335
|
+
const disableRouteChangeHandler = optionsWithDefaults.disableRouteChangeHandler;
|
|
8316
8336
|
const queryClient = useDeepMemo(() => {
|
|
8317
8337
|
var _a;
|
|
8318
|
-
if (reactQueryWithDefaults.clientConfig instanceof
|
|
8338
|
+
if (reactQueryWithDefaults.clientConfig instanceof import_react_query29.QueryClient) {
|
|
8319
8339
|
return reactQueryWithDefaults.clientConfig;
|
|
8320
8340
|
}
|
|
8321
|
-
return new
|
|
8341
|
+
return new import_react_query29.QueryClient({
|
|
8322
8342
|
...reactQueryWithDefaults.clientConfig,
|
|
8323
8343
|
defaultOptions: {
|
|
8324
8344
|
...reactQueryWithDefaults.clientConfig.defaultOptions,
|
|
8325
8345
|
queries: {
|
|
8326
8346
|
refetchOnWindowFocus: false,
|
|
8327
|
-
placeholderData:
|
|
8347
|
+
placeholderData: import_react_query29.keepPreviousData,
|
|
8328
8348
|
...(_a = reactQueryWithDefaults.clientConfig.defaultOptions) == null ? void 0 : _a.queries
|
|
8329
8349
|
}
|
|
8330
8350
|
}
|
|
@@ -8336,7 +8356,7 @@ var Refine = /* @__PURE__ */ __name(({
|
|
|
8336
8356
|
}, [notificationProvider]);
|
|
8337
8357
|
const notificationProviderContextValues = useNotificationProviderValues();
|
|
8338
8358
|
useRouterMisuseWarning(routerProvider);
|
|
8339
|
-
return /* @__PURE__ */ import_react76.default.createElement(
|
|
8359
|
+
return /* @__PURE__ */ import_react76.default.createElement(import_react_query29.QueryClientProvider, { client: queryClient }, /* @__PURE__ */ import_react76.default.createElement(NotificationContextProvider, { ...notificationProviderContextValues }, /* @__PURE__ */ import_react76.default.createElement(
|
|
8340
8360
|
AuthProviderContextProvider,
|
|
8341
8361
|
{
|
|
8342
8362
|
...authProvider ?? {},
|
|
@@ -8358,7 +8378,7 @@ var Refine = /* @__PURE__ */ __name(({
|
|
|
8358
8378
|
onLiveEvent,
|
|
8359
8379
|
options: optionsWithDefaults
|
|
8360
8380
|
},
|
|
8361
|
-
/* @__PURE__ */ import_react76.default.createElement(UnsavedWarnContextProvider, null, /* @__PURE__ */ import_react76.default.createElement(import_react76.default.Fragment, null, children, !disableTelemetryWithDefault && /* @__PURE__ */ import_react76.default.createElement(Telemetry, null), /* @__PURE__ */ import_react76.default.createElement(RouteChangeHandler, null)))
|
|
8381
|
+
/* @__PURE__ */ import_react76.default.createElement(UnsavedWarnContextProvider, null, /* @__PURE__ */ import_react76.default.createElement(import_react76.default.Fragment, null, children, !disableTelemetryWithDefault && /* @__PURE__ */ import_react76.default.createElement(Telemetry, null), !disableRouteChangeHandler && /* @__PURE__ */ import_react76.default.createElement(RouteChangeHandler, null)))
|
|
8362
8382
|
)))
|
|
8363
8383
|
))))))
|
|
8364
8384
|
)));
|