@lark-apaas/client-toolkit 1.1.29-react-query.test.0 → 1.1.30
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/lib/components/AppContainer/index.js +11 -14
- package/lib/server-log/poller.js +4 -2
- package/package.json +1 -2
- package/lib/apis/components/QueryProvider.d.ts +0 -1
- package/lib/apis/components/QueryProvider.js +0 -2
- package/lib/components/QueryProvider/index.d.ts +0 -10
- package/lib/components/QueryProvider/index.js +0 -27
|
@@ -16,7 +16,6 @@ import { TrackKey } from "../../types/tea.js";
|
|
|
16
16
|
import safety from "./safety.js";
|
|
17
17
|
import { getAppId } from "../../utils/getAppId.js";
|
|
18
18
|
import { ServerLogPoller } from "../../server-log/index.js";
|
|
19
|
-
import QueryProvider from "../QueryProvider/index.js";
|
|
20
19
|
registerDayjsPlugins();
|
|
21
20
|
initAxiosConfig();
|
|
22
21
|
const isMiaodaPreview = window.IS_MIAODA_PREVIEW;
|
|
@@ -222,19 +221,17 @@ const AppContainer_AppContainer = (props)=>{
|
|
|
222
221
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
223
222
|
children: [
|
|
224
223
|
/*#__PURE__*/ jsx(safety, {}),
|
|
225
|
-
/*#__PURE__*/ jsx(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
children: children
|
|
237
|
-
})
|
|
224
|
+
/*#__PURE__*/ jsx(ConfigProvider, {
|
|
225
|
+
theme: {
|
|
226
|
+
token: antdThemeToken,
|
|
227
|
+
components: {
|
|
228
|
+
Table: antdTableToken,
|
|
229
|
+
Pagination: antdPaginationToken
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
children: /*#__PURE__*/ jsx(App, {
|
|
233
|
+
themeMeta: props.themeMeta,
|
|
234
|
+
children: children
|
|
238
235
|
})
|
|
239
236
|
})
|
|
240
237
|
]
|
package/lib/server-log/poller.js
CHANGED
|
@@ -122,11 +122,13 @@ class ServerLogPoller {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
log(message, data) {
|
|
125
|
-
|
|
125
|
+
const enableLog = 'true' === localStorage.getItem('debug_server_log_poller');
|
|
126
|
+
if (this.options.debug && enableLog) if (data) console.log(`[ServerLogPoller] ${message}`, data);
|
|
126
127
|
else console.log(`[ServerLogPoller] ${message}`);
|
|
127
128
|
}
|
|
128
129
|
error(message, error) {
|
|
129
|
-
|
|
130
|
+
const enableLog = 'true' === localStorage.getItem('debug_server_log_poller');
|
|
131
|
+
if (enableLog) if (error) console.error(`[ServerLogPoller] ${message}`, error);
|
|
130
132
|
else console.error(`[ServerLogPoller] ${message}`);
|
|
131
133
|
}
|
|
132
134
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/client-toolkit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.30",
|
|
4
4
|
"types": "./lib/index.d.ts",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -148,7 +148,6 @@
|
|
|
148
148
|
"vitest": "^3.2.4"
|
|
149
149
|
},
|
|
150
150
|
"peerDependencies": {
|
|
151
|
-
"@tanstack/react-query": "^5.90.12",
|
|
152
151
|
"antd": ">=5.26.6",
|
|
153
152
|
"react": ">=16.14.0",
|
|
154
153
|
"react-dom": ">=16.14.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as QueryProvider, getDefaultQueryClient } from '../../components/QueryProvider';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
-
declare const getDefaultQueryClient: () => QueryClient;
|
|
4
|
-
export type QueryProviderProps = {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
client?: QueryClient;
|
|
7
|
-
};
|
|
8
|
-
declare const QueryProvider: React.FC<QueryProviderProps>;
|
|
9
|
-
export default QueryProvider;
|
|
10
|
-
export { getDefaultQueryClient };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
4
|
-
let defaultQueryClient = null;
|
|
5
|
-
const getDefaultQueryClient = ()=>{
|
|
6
|
-
if (!defaultQueryClient) defaultQueryClient = new QueryClient({
|
|
7
|
-
defaultOptions: {
|
|
8
|
-
queries: {
|
|
9
|
-
retry: 1,
|
|
10
|
-
refetchOnWindowFocus: false
|
|
11
|
-
},
|
|
12
|
-
mutations: {
|
|
13
|
-
retry: 1
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
return defaultQueryClient;
|
|
18
|
-
};
|
|
19
|
-
const QueryProvider = ({ children, client })=>{
|
|
20
|
-
const qc = client ?? getDefaultQueryClient();
|
|
21
|
-
return /*#__PURE__*/ jsx(QueryClientProvider, {
|
|
22
|
-
client: qc,
|
|
23
|
-
children: children
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
const components_QueryProvider = QueryProvider;
|
|
27
|
-
export { components_QueryProvider as default, getDefaultQueryClient };
|