@lark-apaas/client-toolkit 1.1.39-alpha.0 → 1.2.0-alpha.10
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.
|
@@ -6,7 +6,6 @@ import { useUpdatingRef } from "../../hooks/useUpdatingRef.js";
|
|
|
6
6
|
import { submitPostMessage } from "../../utils/postMessage.js";
|
|
7
7
|
import { getPreviewParentOrigin } from "../../utils/getParentOrigin.js";
|
|
8
8
|
import { childApi } from "./utils/childApi.js";
|
|
9
|
-
import { batchLogInfo } from "../../logger/batch-logger.js";
|
|
10
9
|
import "./utils/listenHot.js";
|
|
11
10
|
var IframeBridge_RouteMessageType = /*#__PURE__*/ function(RouteMessageType) {
|
|
12
11
|
RouteMessageType["RouteChange"] = "RouteChange";
|
|
@@ -22,11 +21,6 @@ async function connectParent() {
|
|
|
22
21
|
type: 'PreviewReady',
|
|
23
22
|
data: {}
|
|
24
23
|
});
|
|
25
|
-
batchLogInfo('info', JSON.stringify({
|
|
26
|
-
type: 'PreviewReady',
|
|
27
|
-
timestamp: Date.now(),
|
|
28
|
-
url: window.location.href
|
|
29
|
-
}));
|
|
30
24
|
const connection = connectToParent({
|
|
31
25
|
parentOrigin: getPreviewParentOrigin(),
|
|
32
26
|
methods: {
|
|
@@ -2,6 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
3
|
import { ConfigProvider } from "antd";
|
|
4
4
|
import { MiaodaInspector } from "@lark-apaas/miaoda-inspector";
|
|
5
|
+
import zh_CN from "antd/locale/zh_CN";
|
|
5
6
|
import IframeBridge from "./IframeBridge.js";
|
|
6
7
|
import { defaultUIConfig } from "../theme/ui-config.js";
|
|
7
8
|
import { Toaster } from "./sonner.js";
|
|
@@ -236,6 +237,7 @@ const AppContainer_AppContainer = (props)=>{
|
|
|
236
237
|
/*#__PURE__*/ jsx(safety, {}),
|
|
237
238
|
/*#__PURE__*/ jsx(QueryProvider, {
|
|
238
239
|
children: /*#__PURE__*/ jsx(ConfigProvider, {
|
|
240
|
+
locale: zh_CN,
|
|
239
241
|
theme: {
|
|
240
242
|
token: antdThemeToken,
|
|
241
243
|
components: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import sockjs_client from "sockjs-client";
|
|
2
2
|
import { submitPostMessage, submitSlardarEvent } from "../../../utils/postMessage.js";
|
|
3
|
-
import { batchLogInfo } from "../../../logger/batch-logger.js";
|
|
4
3
|
import { getWsPath } from "../../../utils/utils.js";
|
|
5
4
|
let hotInited = false;
|
|
6
5
|
function handleDevServerMessage(msg) {
|
|
@@ -16,28 +15,15 @@ function handleDevServerMessage(msg) {
|
|
|
16
15
|
},
|
|
17
16
|
data: null
|
|
18
17
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
msg: {
|
|
29
|
-
type: 'errors',
|
|
30
|
-
data: JSON.stringify(msg.data)
|
|
31
|
-
},
|
|
32
|
-
data: null
|
|
33
|
-
});
|
|
34
|
-
batchLogInfo('info', JSON.stringify({
|
|
35
|
-
type: 'HmrMessage',
|
|
36
|
-
subType: 'errors',
|
|
37
|
-
timestamp: Date.now(),
|
|
38
|
-
errorCount: msg.data?.length
|
|
39
|
-
}));
|
|
40
|
-
} else if ('hmr-timing' === msg.type) {
|
|
18
|
+
} else if ('errors' === msg.type) submitPostMessage({
|
|
19
|
+
type: 'HmrMessage',
|
|
20
|
+
msg: {
|
|
21
|
+
type: 'errors',
|
|
22
|
+
data: JSON.stringify(msg.data)
|
|
23
|
+
},
|
|
24
|
+
data: null
|
|
25
|
+
});
|
|
26
|
+
else if ('hmr-timing' === msg.type) {
|
|
41
27
|
const { duration, fileCount, fileTotalSize } = msg.data;
|
|
42
28
|
submitSlardarEvent({
|
|
43
29
|
name: 'runTiming',
|
|
@@ -50,14 +36,6 @@ function handleDevServerMessage(msg) {
|
|
|
50
36
|
fileTotalSize
|
|
51
37
|
}
|
|
52
38
|
});
|
|
53
|
-
batchLogInfo('info', JSON.stringify({
|
|
54
|
-
type: 'HmrMessage',
|
|
55
|
-
subType: 'hmr-timing',
|
|
56
|
-
timestamp: Date.now(),
|
|
57
|
-
duration,
|
|
58
|
-
fileCount,
|
|
59
|
-
fileTotalSize
|
|
60
|
-
}));
|
|
61
39
|
}
|
|
62
40
|
}
|
|
63
41
|
function connectDevServer() {
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import { createClient } from "@lark-apaas/client-capability";
|
|
2
|
+
import { normalizeBasePath } from "./utils/utils.js";
|
|
1
3
|
import { version } from "../package.json";
|
|
4
|
+
const capabilityClient = createClient({
|
|
5
|
+
baseURL: normalizeBasePath(process.env.CLIENT_BASE_PATH),
|
|
6
|
+
fetchOptions: {
|
|
7
|
+
headers: {
|
|
8
|
+
'X-Suda-Csrf-Token': window.csrfToken ?? ''
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
});
|
|
2
12
|
const src = {
|
|
3
13
|
version: version
|
|
4
14
|
};
|
|
5
|
-
export { src as default };
|
|
15
|
+
export { capabilityClient, src as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/client-toolkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-alpha.10",
|
|
4
4
|
"types": "./lib/index.d.ts",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -80,7 +80,8 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@ant-design/colors": "^7.2.1",
|
|
82
82
|
"@ant-design/cssinjs": "^1.24.0",
|
|
83
|
-
"@data-loom/js": "
|
|
83
|
+
"@data-loom/js": "0.4.4-alpha.4",
|
|
84
|
+
"@lark-apaas/client-capability": "^0.1.0",
|
|
84
85
|
"@lark-apaas/miaoda-inspector": "^1.0.8",
|
|
85
86
|
"@lark-apaas/observable-web": "^1.0.0",
|
|
86
87
|
"@radix-ui/react-avatar": "^1.1.10",
|